Could someone show me how to use preg_replace to change this:

test <OPTION VALUE="test">test</OPTION> test


anotherword <OPTION VALUE=\"test\">test</OPTION> anotherword

basically, I want to change a value only if it is not in an option

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.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to