Browse by Tags
Showing page 2 of 2 (16 total posts)
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 ...
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 ...
In PHP I'm trying to filter the string looking for:
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 ...
see this text:foo bar <b> foo bar</b>
foo bar <b> foo bar</b> foo bari need a expression, which finds all the foo expect the <b>-included like here underlined:
foo bar <b> foo bar</b> foo bar <b> foo bar</b> foo barThere can be many <b>-Tags. They are correct ...
I am using PHP and preg_replace. I have output from an XSL transformation that I would like to insert into a mysql database. I would like to construct a regular expression that escapes single and double quotes. My data set looks like this:
<escape>Welcome to Barbara's ...