File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,34 @@ Returns a hash of named submatches.
68
68
69
69
= head2 method prematch
70
70
71
+ Defined as:
72
+
73
+ method prematch(Match:D:) returns Str:D
74
+
71
75
Returns the part of the original string leading up to the match.
72
76
77
+ 'abcdefg' ~~ /cd/;
78
+ say $/.prematch; # ab
79
+
80
+ # will return a list of three match objects
81
+ "abc123def" ~~ m:g/\d/;
82
+ say $/.[1].prematch; # abc1
83
+
73
84
= head2 method postmatch
74
85
86
+ Defined as:
87
+
88
+ method postmatch(Match:D:) returns Str:D
89
+
75
90
Returns the part of the original string following the match.
76
91
92
+ 'abcdefg' ~~ /cd/;
93
+ say $/.postmatch; # efg
94
+
95
+ # will return a list of three match objects
96
+ "abc123def" ~~ m:g/\d/;
97
+ say $/.[1].postmatch; # 3def
98
+
77
99
= head2 method make
78
100
79
101
method make(Match:D: Mu $ast)
You can’t perform that action at this time.
0 commit comments