Results 1 to 2 of 2
Jul 27, 2001, 16:13 #1
- Join Date
- Oct 2000
- 0 Post(s)
- 0 Thread(s)
how to exempt html tags from regular expressions?
hi, I'm having a little trouble figuring out how to basically exempt html code from regular expressions. I have a search function on my site that searches through a mysql table and outputs the results with the search word in bold. The problem is that if the search word is located between link tags for example, the bold tags will break the link. Also, if someone searches for the letter b for instance, when everything is outputted to the browser all <br> tags are broken.
So, basically, how do you go about using ereg_replace only on text that is not between < and > and that is not between <a href...> and </a>
thanks in advance.
Jul 27, 2001, 19:00 #2
I'd explode("<") and (">"), but there's probably a faster solution.