Hi,
I wrote a little search script for a client, it works and words get highlited, BUT...
Imagine this situation:
search term: test
found result: Hello this <a href="/news/this-is-a-test">is a test</a>
In this example both 'test' in the href part and between the <a>
tags get highlited, breaking the link.
How could I prevent this?
Edit:
So this is what I need: A regex replace function that replaces all matched search strings EXCEPT the ones that are located inside a href attribute
Greets, nick