But the regex is forced to backtrack if <(\w+TagIwant\b) is not optional otherwise it concludes happily.
Changing to .+? should solve this.
just tested, not my day. declaring myself officially (mentally) ill.
an elegant solution is buried at the end of this discussion here
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re: Regex Optional capture doesn't
by LanX
in thread Regex Optional capture doesn't
by NetWallah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |