Skip to content

Commit

Permalink
Document recent changes to allow non-inclusive ranges as quantifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ungrim97 committed Nov 16, 2015
1 parent 9726ca5 commit 3754fdc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/Language/regexes.pod
Expand Up @@ -351,6 +351,25 @@ is possible: C<a ** 5> matches C<a> exactly five times.
say Bool('aaaaa' ~~ /a ** 5/); #-> True
=end code
It is also posible to use non inclusive ranges using a carat:
=begin code
say Bool('a' ~~ /a ** 1^..^6); #-> False
say Bool('aaaa' ~~ /a ** 1^..^6); #-> True
=end code
This includes the numeric ranges staring from 0:
=begin code
say Bool('aaa' ~~ /a ** ^6/); #->true
=end code
or a Whatever operator for an infinite range with a non inclusive minimum:
=begin code
say Bool('aaaa' ~~ /a ~~ 1^..*/); #-> True
=end code
=head2 X<Modified quantifier: %|regex,%;regex,%%>
To more easily match things like comma separated values, you can tack on a
Expand Down

0 comments on commit 3754fdc

Please sign in to comment.