I'm trying to write a regex to match words on boundery and because text is in html I need to avoid words that are in <a>here more words</a>
.
My regex for now is: /word/u
Example text:
<p>Example lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur <a href="">porta lorem nec</a> tortor laoreet gravida.</p>
Searching for word lorem
should be replaced only at the beginning, not in <a>
.