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
/
(?<!\\)<([\w\.-]*[^\/\s>])(?:\s*)([^>]*)>(.*?[^<\/>]+)(?:<\/\1>)
/
gm
Input 1
New
This is a <A1>test</A1> of <A2>the</A2> regex. It <B1 attrA="valueA" attrB="valueB">should capture</B1> one <B2 attrA=0.123 attrA="17">or more</B2> attributes. Tags <C.One>and attributes</C.One> may or <D attr_1="value_1">may not include</D> periods, dashes, or underscores. Attributes may be<E attrC=True>boolean</E>, <F attrD="valueD">textual</F>, or <G attrD=10.523>numeric.</G> Numeric attributies may use <H attrE=5>integers</H> or <I attrF=0.123>floats.</I> Finally <J>tags may contain text that is manually broken across several lines.</J> of text. Nested <K>tags <L>should be <M>supported</M> up to</L> 3 levels</K>. The parser \<should\> ignore escaped and non-attribute assignment 55="55". Optionally a <N attrList=["A", "B", "C"]>list of</N> attributes.
Extraction
{$1},{$2},{$3}\n
This is a <A1>test</A1> of <A2>the</A2> regex. It <B1 attrA="valueA" attrB="valueB">should capture</B1> one <B2 attrA=0.123 attrA="17">or more</B2> attributes. Tags <C.One>and attributes</C.One> may or <D attr_1="value_1">may not include</D> periods, dashes, or underscores. Attributes may be<E attrC=True>boolean</E>, <F attrD="valueD">textual</F>, or <G attrD=10.523>numeric.</G> Numeric attributies may use <H attrE=5>integers</H> or <I attrF=0.123>floats.</I> Finally <J>tags may contain text that is manually broken across several lines.</J> of text. Nested <K>tags <L>should be <M>supported</M> up to</L> 3 levels</K>. The parser \<should\> ignore escaped and non-attribute assignment 55="55". Optionally a <N attrList=["A", "B", "C"]>list of</N> attributes.