perl6-docs icon indicating copy to clipboard operation
perl6-docs copied to clipboard

"Introduction to Perl 6 Regex" clarification on quantifier ( * vs + ) ?

Open jubilatious1 opened this issue 6 years ago • 0 comments

Hello, on the "Introduction to Perl 6 Regex" page the following statement is found:

/ 'foo.' * / # will match "foo.", "foo.foo.", "foo.foo.foo.", etc.

Doesn't the star (*) quantifier also match the empty string "" ?

Rather than adding the empty string to the text above, would a better example be a regex using the plus (+) quantifier, as below?

/ 'foo.' + / # will match "foo.", "foo.foo.", "foo.foo.foo.", etc.

Thank you.

Ref: https://github.com/perlpilot/perl6-docs/blob/master/intro/p6-regex-intro.pod

jubilatious1 avatar Sep 14 '19 16:09 jubilatious1