File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,25 @@ is possible: C<a ** 5> matches C<a> exactly five times.
351
351
say Bool('aaaaa' ~~ /a ** 5/); #-> True
352
352
= end code
353
353
354
+ It is also posible to use non inclusive ranges using a caret:
355
+
356
+ = begin code
357
+ say Bool('a' ~~ /a ** 1^..^6); #-> False
358
+ say Bool('aaaa' ~~ /a ** 1^..^6); #-> True
359
+ = end code
360
+
361
+ This includes the numeric ranges staring from 0:
362
+
363
+ = begin code
364
+ say Bool('aaa' ~~ /a ** ^6/); #->true
365
+ = end code
366
+
367
+ or a Whatever operator for an infinite range with a non inclusive minimum:
368
+
369
+ = begin code
370
+ say Bool('aaaa' ~~ /a ~~ 1^..*/); #-> True
371
+ = end code
372
+
354
373
= head2 X < Modified quantifier: %|regex,%;regex,%% >
355
374
356
375
To more easily match things like comma separated values, you can tack on a
You can’t perform that action at this time.
0 commit comments