Regular Expression to isolate an html tag

Posted by orit cohen on Stack Overflow See other posts from Stack Overflow or by orit cohen
Published on 2012-07-11T15:10:44Z Indexed on 2012/07/11 15:15 UTC
Read the original article Hit count: 238

Filed under:
|
|
|
|

I'm looking for a regular expression to isolate an html tag. This includes the TAG the ATTRIBUTES and the CONTNET inside.

Let's say I have this:

<html> 
<body>
aajsdfkjaskd 
<TAGNAME name="bla" context="non">hfdfhdj </TAGNAME>
</body>
 </html>

I need a regular expression that would return:

<TAGNAME name="bla" context="non">hfdfhdj </TAGNAME>

Thank, Joe

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript