Perl does not like variable length lookaround.
It doesn't like variable length look-behinds but variable length look-aheads are ok. You can get around the limitation by specifying an alternation of different length look-behinds, for example
if ( $str =~ m{ (?: (?<=\A) | (?<=XXX) ) \d+ }x ) { ... }
i.e do something if we find one or more digits preceded by either the beginning of the string or three 'X's. Note that I use the 'x' pattern modifier to allow whitespace and comments inside the pattern to aid readability.
I hope this is of use.
Cheers,
JohnGG
In reply to Re^4: Help with matching .org
by johngg
in thread Help with matching .org
by bestresearch2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |