Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`**` quantifier with dynamic count, misbehaves under `:exhaustive` matching #6051

Open
p6rt opened this issue Feb 3, 2017 · 2 comments
Open

`**` quantifier with dynamic count, misbehaves under `:exhaustive` matching #6051

p6rt opened this issue Feb 3, 2017 · 2 comments
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Feb 3, 2017

Migrated from rt.perl.org#130711 (status was 'new')

Searchable as RT130711$

@p6rt
Copy link
Author

@p6rt p6rt commented Feb 3, 2017

From @smls

Normally, the `**` quantifier doesn't care whether the count is
specified as a literal or as an expression enclosed in `{ }`​:

  say "abc".match(/\w ** 2/) # 「ab」
  say "abc".match(/\w ** {2}/) # 「ab」

  say "abc".match(/\w ** 2/, :ov) # (「ab」 「bc」)
  say "abc".match(/\w ** {2}/, :ov) # (「ab」 「bc」)

But when the `​:exhaustive` flag is active, it misbehaves when the
count is specified as a `{ }` expression​:

  say "abc".match(/\w ** 2/, :ex) # (「ab」 「bc」)
  say "abc".match(/\w ** {2}/, :ex) # (「ab」 「a」 「bc」 「b」)

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 26, 2017

From @smls

This bug is still present in

Rakudo version 2017.08-8-g753c9a5ea built on MoarVM version 2017.08.1-19-g151a2563
implementing Perl 6.c.

@p6rt p6rt added the regex label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.