As a rule of thumb:
Every non-Letter character after the opening angle bracket makes it
non-capturing.
Am 22.02.2016 um 11:37 schrieb Theo van den Heuvel:
Thanks Patrick,
it works great.
Theo
Patrick R. Michaud schreef op 2016-02-22 11:16:
Dynamic subregexes such as <$top> are non-capturi
Thanks Patrick,
it works great.
Theo
Patrick R. Michaud schreef op 2016-02-22 11:16:
Dynamic subregexes such as <$top> are non-capturing by default. You
can easily capture the result by using something like
instead:
$ cat xyz.p6
my $match;
my $top = rx/ \( $ = [ \w* ] \) /;
Dynamic subregexes such as <$top> are non-capturing by default. You can easily
capture the result by using something like instead:
$ cat xyz.p6
my $match;
my $top = rx/ \( $ = [ \w* ] \) /;
given "(abc)" {
$match = m/^ /;
}
if $match {
say
Hi all,
I am trying to change a regex programmatically. For that I insert a
variable in another regex. However, the match object appears to have
lost the capture of the inner regex. In a code example:
=
my Match $match;
my $top = rx/ \( $ = [ \w* ] \) /;
given "(abc)" {
$match = m