@@ -204,18 +204,18 @@ Takes as an argument the number of matches to return, stopping once the specifie
204
204
Examples:
205
205
= begin code
206
206
207
- "properly".match('perl'); # 「perl」
208
- "properly".match(/p.../); # 「perl」
209
- "1 2 3".match([1,2,3]); # 「1 2 3」
210
- "a1xa2".match(/a./, :continue(2)) #「a2」
211
- "abracadabra".match(/ a .* a /, :exhaustive); #(「abracadabra」 「abracada」 「abraca」 「abra」 「acadabra」 「acada」 「aca」 「adabra」 「ada」 「abra」)
212
- 'several words here'.match(/\w+/,:global) #(「several」 「words」 「here」)
213
- 'abcdef'.match(/.*/, :pos(2)) #「cdef」
214
- "foo[bar][baz]".match(/../, :1st); # 「fo」
215
- "foo[bar][baz]".match(/../, :2nd); # 「o[」
216
- "foo[bar][baz]".match(/../, :3rd); # 「ba」
217
- "foo[bar][baz]".match(/../, :4th); # 「r]」
218
- "foo[bar][baz]bada".match('ba', :x(2)); # (「ba」 「ba」)
207
+ say "properly".match('perl'); # 「perl」
208
+ say "properly".match(/p.../); # 「perl」
209
+ say "1 2 3".match([1,2,3]); # 「1 2 3」
210
+ say "a1xa2".match(/a./, :continue(2)) #「a2」
211
+ say "abracadabra".match(/ a .* a /, :exhaustive); #(「abracadabra」 「abracada」 「abraca」 「abra」 「acadabra」 「acada」 「aca」 「adabra」 「ada」 「abra」)
212
+ say 'several words here'.match(/\w+/,:global) #(「several」 「words」 「here」)
213
+ say 'abcdef'.match(/.*/, :pos(2)) #「cdef」
214
+ say "foo[bar][baz]".match(/../, :1st); # 「fo」
215
+ say "foo[bar][baz]".match(/../, :2nd); # 「o[」
216
+ say "foo[bar][baz]".match(/../, :3rd); # 「ba」
217
+ say "foo[bar][baz]".match(/../, :4th); # 「r]」
218
+ say "foo[bar][baz]bada".match('ba', :x(2)); # (「ba」 「ba」)
219
219
= end code
220
220
221
221
0 commit comments