|
|
Browse by Tags
All Tags » preg_replace
Showing page 1 of 2 (12 total posts)
-
Platform: PCRE
Purpose: am trying to teach myself a little PCRE. In particular an expression has been nagging me:
<?php
$text="this-that <a href=\"http://www.my-site.com/index.php\">this-that</a> ...
-
what i'm trying to do is remove all line breaks in and around certain html (or xml if you will) elements (h[0-9], ul, li) from a string
the following works fine for removing leading and trailing line breaks, but not the ones inside the element:
$text = ...
-
I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works:
/(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi
what I want it to do is if [*code] and [*/code] are around the text inside, ...
-
I'm trying to find words in HTML that are between tags using PHP (v5.2.6) preg_replace.
The following rules apply to the matches
full word match only (can also be matched when adjacent to non-word characters such as commas, parenthesis, periods, question marks, exclamation marks, percentage, dollar signs)
e.g. "test" would ...
-
I need the following string: [Link Name|Link Description] (this is standard mediawiki text for links)
to become this: "Link Description"[Link Name] (this is a proprietary wiki format)
Link Description and Link Name are arbitrary values...it will always be bracket, text, pipe, text, bracket
I'm using php and I've attempted to ...
-
Hi,
Let me explain the scenerio: I have the input text "Mr. XYZ is a very nice person and have a very good taste of humor"
I want to write one replace string and once pattern string such that I can do the following things:
er -> gh
av -> th
these are two papperts that I can match with the pattern string ...
-
Hi,
Anybody knows how to replace the second or third instance of word in a text using regular expression in php (preg_replace())
For example, I have an article about car and let's say the word car occurs 10 times. Now I want to replace the 3rd and 7th instance
of car with some other word. How can I do this with php regular ...
-
Hi,,
Any body please help me on this preg_replace..
My need is to add one extra space to in front of the characters except some limited character.
For any tag which has the form "<XXXXX> OR</XXXXX> should
be added one extra space like " <XXXXX> OR </XXXXX>" except
"<span> OR ...
-
Hi, I asking for help in my PHP code optimization. I try to rewrite my old/slow BBCode conversion function to use regex. The allowed BBCodes are
[ b]text[ /b]
[ i]text[ /i]
[ url]domain.com[ /url] or [ url]domain.com|domainname[ /url]
[ img]filename.ext[ /img] or [ img]filename.ext|description[ /img]
It is possible to construct ...
-
Hi,
In PHP I'm trying to filter the string looking for:
[options=1,6,22,103]
and then to extract numeric values into the array. As I just started my fun with regular expressions, the only way I can do it is like:
preg_match('\/[options=(.*?)\]/', $content, $matches);
But that will return numbers separated with commas, which ...
1
|
|
|