in reply to Re: Evaluating code in a regex at runtime: (??{...})
in thread Evaluating code in a regex at runtime: (??{...})
> Note that the contents of the match are still accessible via a named capture group:
> ... ('a' x 100) =~ /(?<match>(??{'(.)' x 100}))/;
ehm ... what you're showing also works with unnamed capture groups:
DB<113> ('a' x 10) =~ /((??{'(.)' x 10}))/; print "<$1>" => 1 <aaaaaaaaaa>
The OP's point was about dynamically generated capture groups, but yours is outside the embedded Perl code.
Cheers Rolf
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Evaluating code in a regex at runtime: (??{...})
by Athanasius (Archbishop) on Jan 28, 2013 at 08:44 UTC | |
by LanX (Saint) on Jan 28, 2013 at 09:09 UTC |
In Section
Seekers of Perl Wisdom