We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9d1ef4e + 6ee2200 commit 30b231cCopy full SHA for 30b231c
doc/Language/regexes.pod
@@ -604,6 +604,13 @@ and slightly verbose -- way of naming captures is like this:
604
The access to the named capture, C<< $<myname> >>, is a shorthand for indexing
605
the match object as a hash, in other words: C<$/{ 'myname' }> or C<< $/<myname> >>.
606
607
+Named captures can also be nested using regular capture group syntax:
608
+
609
+ if 'abc-abc-abc' ~~ / $<string>=( [ $<part>=[abc] ]* % '-' ) / {
610
+ say ~$<string> # abc-abc-abc
611
+ say ~$<string><part> # [abc, abc, abc]
612
+ }
613
614
Coercing the match object to a hash gives you easy programmatic access to
615
all named captures:
616
0 commit comments