Skip to content

Commit 9d1ef4e

Browse files
committed
Merge pull request #199 from ungrim97/feature/document_quantifier_changes
Document recent changes to allow non-inclusive ranges as quantifiers
2 parents 9726ca5 + 4993047 commit 9d1ef4e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/Language/regexes.pod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,25 @@ is possible: C<a ** 5> matches C<a> exactly five times.
351351
say Bool('aaaaa' ~~ /a ** 5/); #-> True
352352
=end code
353353
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+
354373
=head2 X<Modified quantifier: %|regex,%;regex,%%>
355374
356375
To more easily match things like comma separated values, you can tack on a

0 commit comments

Comments
 (0)