Captures
- Each captured element in $/ is itself a Match object
- Thus subpatterns can be nested
/ ( (\w+) '=' (\d+) ) /
- In Perl 5 the above would go to $1, $2, and $3
- In Perl 6 they go to $/[0], $/[0][0], and $/[0][1]
Parrot | Perl 6 regexes | #18 |
/ ( (\w+) '=' (\d+) ) /
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |