Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
(?P<content>.*?) # Content up to next tag (?P<markup> # Entire tag <!\[CDATA\[(?P<cdata>.+?)]]>| # <![CDATA[ ... ]]> <!--(?P<comment>.+?)-->| # <!-- Comment --> </\s*(?P<close_tag>\w+)\s*>| # </tag> <(?P<tag>\w+) # <tag ... (?P<attributes> (?P<attribute>\s+ # <snip>: Use this part to get the attributes out of 'attributes' group. (?P<attribute_name>\w+) (?:\s*=\s* (?P<attribute_value> [\w:/.\-]+| # Unquoted (?=(?P<_v> # Quoted (?P<_q>['\"]).*?(?<!\\)(?P=_q))) (?P=_v) ))? # </snip> )* )\s* (?P<is_self_closing>/?) # Self-closing indicator >) # End of tag
"
gsx
Unit Tests
There are no unit tests, click
here
to add some.