Regex Help
| From: | Jim | Date: | Thu, 19 Dec 2002 17:26:11 +0000 |
| Subject: | Regex Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128883@lists.php.net to get a copy of this message | ||
Could someone show me how to use preg_replace to change this:
test <OPTION VALUE="test">test</OPTION> test
into:
anotherword <OPTION VALUE=\"test\">test</OPTION> anotherword
basically, I want to change a value only if it is not in an option
tag.....
I also want to account for situations like :
test, something <OPTION VALUE="test">test</OPTION> test!
My thoughts were to do the replace if the word (test) was not
surrounded by quotes or surrounded by greater/less than symbols. I
just have no idea how to formulate that with regex.
Please help! Thanks.