I am trying to find HTML tags, via PHP EREG, in which For example: This is the best I can come with: The problem is that, it will match the 3 groups in which Hope anyone can help, Cheers, Egil Ps. Sorry for the unnecessary title, nothing can think better. Add a Negative character classes {xxx} Right before the closing tag - where xxx can be [A-Za-z0- 9 _ \ -] * . & lt; P & gt; Xxxx & lt; / P & gt; & Lt; P & gt; Yyyy {asdf} & lt; / P & gt; / xxxx & lt; / P & gt; & Lt; P & gt; Yyyy , and I should only have yyyy in this situation
? After each + and * in your regex, the match will be less greedy. [^ {< [^} & lt; & Gt;]
Comments
Post a Comment