Skip to content

Commit ca2186e

Browse files
committed
Add docs for modified quantifier
1 parent e89c8d6 commit ca2186e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Language/regexes.pod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ C<a ** 2..5> to match the character C<a> at least twice and at most 5 times.
347347
If the minimal and maximal number of matches are the same, a single integer
348348
is possible: C<a ** 5> matches C<a> exactly five times.
349349
350+
=head2 X<Modified quantifier: %|regex,%>
351+
352+
To more easily match things like comma separated values, you can tack on a
353+
C<%> modifier to any of the above quantifiers to specify a separator than must
354+
occur between each of the matches. So, for example C<a+ % ','> will match
355+
C<a> or C<a,a> or C<a,a,a> or so on, but it will not match C<a,> or C<a,a,>.
356+
To match those as well, you may use C<%%> instead of C<%>.
357+
350358
=head1 X<Alternation|regex,||>
351359
352360
To match one of several possible alternatives, separate them by C<||>; the

0 commit comments

Comments
 (0)