Valid Regular expressions for HTML tags (not trivial)?
I want develop very good regular expression for HTML tags but not sure
about syntax and not known where to find reference for this information.
Let's think about simple tag first:
<a href="#xxx" />xxx</a>
Question is what is valid regular expression for it?
<a\s+href\s*=\s*"[^"]*?"\s*/\s*>
<a\s+href="[^"]*?"\s*/>
Let's think about single tag as second:
<br/>
Question is what is valid regular expression for it?
<\s*br\s*/\s*>
<\s*br\s*/>
Where is some online reference for it - it trivial question but hard to
find in web search since to simple - can you share some experience?
No comments:
Post a Comment