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>
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…