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.
1 parent 72dad49 commit cd16648Copy full SHA for cd16648
doc/Type/Match.pod6
@@ -110,6 +110,18 @@ Returns the matched text.
110
"abc123def" ~~ /\d+/;
111
say $/.Str; # OUTPUT: «123»
112
113
+=head2 method Int
114
+
115
+Defined as:
116
117
+ method Int(Match:D: --> Int:D)
118
119
+Tries to convert stringified result of the matched text into Int.
120
121
+ say ('12345' ~~ /234/).Int; # OUTPUT: «234»
122
+ # the next line produces a warning about using Nil (result of a no match) in numeric context
123
+ say ('one-two' ~~ /234/).Int; # OUTPUT: «0» # because Nil.Int returns 0
124
125
=head2 method caps
126
127
Returns a list of pairs, with the index or submatch name as key and
0 commit comments