DB<132> p $x <blah1 phase="2" type="MyType" more_keys="Values" <Unwanted/> <SomeTa +gIwant><k1="v1"></SomeTagIwant> DB<133> $re = qr/\btype="([^"]+)".+?<(\w+TagIwant\b|$)/ DB<134> print join "|", $x =~ $re MyType|SomeTagIwant
DB<154> p $x <blah1 phase="2" type="MyType" more_keys="Values" <Unwanted/> <SomeTa +gIwant><k1="v1"></SomeTagIwant> DB<155> p $y <blah1 phase="2" type="MyType" more_keys="Values" <Unwanted/> DB<156> $re = qr/ \btype = "([^"]+)" .+? (?: < ( \w+TagIwant)\b | $ + ) /x DB<157> print join "|", $x =~ $re MyType|SomeTagIwant DB<158> print join "|", $y =~ $re MyType|
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^8: Regex Optional capture doesn't (solved !)
by LanX
in thread Regex Optional capture doesn't
by NetWallah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |