So you can't make $InnerRe anchorred at the beginning, and not anchorred at the beginning, all in the same match invocation.
It's not a problem. My solution even does this.
$\ = "\n"; my $re; $re = qr/ a (??{ $re }) c | b /x; print 'aabcc' =~ /^$re/ ||0; # 1 print '!aabcc' =~ /^$re/ ||0; # 0 First call is anchored to start. print 'a!abcc' =~ /^$re/ ||0; # 0 Recursive call is anchored to pos. print 'aa!bcc' =~ /^$re/ ||0; # 0 Recursive call is anchored to pos.
In reply to Re^2: A regexp to parse nested brackets containing strings
by ikegami
in thread A regexp to parse nested brackets containing strings
by dfaure
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |