Hi

I'm trying to write a pattern that catches every occurrence of a word as long as
that word is not inside an html tag.

e.g I want to catch `Hello World` but not <img title="Hello World" />

The closest I got was 

(?!<.*?)Hello World(?![^<>]*?>) 

which works OK in BBEdit search, but, and here's where I apologise for possibly
taking this question off topic - not in a PHP page 
(where it looks like this: $pattern = "'(?!{.*?)$string(?![^{}]*?})'si"; )
where I'm using it to highlight certain words.

Does anyone with a lot more experience with regular expressions know the (more
than likely obvious) way to make this work in PHP too?

Kind Regards

Nicklas


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to