Hi Folks,
To find whole words I have got this working:
Instead of \\b I also tried \\w and \\W
This nicely captures whole words as expected, but:
I would like to avoid for example [blue]word[/blue] in [red]<word[/red] and [red]word=[/red]
because they could be tags or attributes.
I cannot figure out a pattern that does all that.
[gray](BTW I really need preg_replace even if it takes more processing power)[/gray]
To find whole words I have got this working:
Code:
$pattern[]="/\\b(" . trim($a) . ")\\b/i";
This nicely captures whole words as expected, but:
I would like to avoid for example [blue]word[/blue] in [red]<word[/red] and [red]word=[/red]
because they could be tags or attributes.
I cannot figure out a pattern that does all that.
[gray](BTW I really need preg_replace even if it takes more processing power)[/gray]