I was wondering if anyone here knew about regular expressions in PHP or PERL? I'm trying to parse some web content and dynamically replace keywords with specific styling, but must not replace keywords contained in HTML tags or content headings. This is what I have so far:
This achieves stopping the replacement of content within HTML tags, but I still need to stop the replacement of content between heading and link tags - e.g.:
and
Many thanks in advance.
/(?!<.*?) MY_WORD (?![^<>]*?>)/
This achieves stopping the replacement of content within HTML tags, but I still need to stop the replacement of content between heading and link tags - e.g.:
<h1>My_Content</h1>
and
<a href='http://www.blitzbasic.com'>My_Content</a>
Many thanks in advance.