From 3754fdcaf743ffca033f8aac15abc8f9d858135d Mon Sep 17 00:00:00 2001 From: Mike Francis Date: Mon, 16 Nov 2015 13:21:32 +0000 Subject: [PATCH] Document recent changes to allow non-inclusive ranges as quantifiers --- doc/Language/regexes.pod | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/Language/regexes.pod b/doc/Language/regexes.pod index 13894ffbd..f8c20277d 100644 --- a/doc/Language/regexes.pod +++ b/doc/Language/regexes.pod @@ -351,6 +351,25 @@ is possible: C matches C 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 To more easily match things like comma separated values, you can tack on a