But I think the explanation is still the same. (point 1)
The fix doesn't work because the regex has to decide which non-greedy ? has "precedence".
I know there are ways to handles this in one regex, but my advice is just to use a second one checking the tail of the string. (point 2)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^3: Regex Optional capture doesn't
by LanX
in thread Regex Optional capture doesn't
by NetWallah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |