in reply to Re^2: Regex Optional capture doesn't
in thread Regex Optional capture doesn't
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex Optional capture doesn't (updated)
by LanX (Saint) on Oct 05, 2017 at 16:55 UTC | |
by NetWallah (Canon) on Oct 05, 2017 at 17:40 UTC | |
by LanX (Saint) on Oct 05, 2017 at 17:47 UTC | |
by NetWallah (Canon) on Oct 05, 2017 at 17:57 UTC | |
by LanX (Saint) on Oct 05, 2017 at 18:07 UTC | |
|