Regex Issue: Match utf-8 words in a string which are not links

Jekil

New Member
I have a string (which can have html code inside) and I'm trying to find some words and replace them. I'm not really good at regex and i encounter difficulties to write the regex i need. The big issue is that the both string and tags are utf-8.I already manage to find some regex patterns wich partially help me:[*]\[code\]/$search_tag/is\[/code\]This pattern will match all the words i'm trying to find but if in my original string the word is a link then i don't want this to match so this doesn't help.[*]\[code\]\'(?!((<.*?)|(<a.*?)))(\b'.$search_tag.'\b)(?!(([^<>]*?)>)|([^>]*?</a>))\'is\[/code\]This second pattern solve the previous i had but just partially, if the word i'm trying is part of 'combination' of words which are marked as link, then this particular word is not match, however if only the word is marked as link then i still get a match, which i don't want to happen.Hope i described the problem well enough to get some help. If needed i can provide further details or even some examples.
 
Back
Top