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

[REGEX] @ symbol'd array interpolation doesn't backtrack (from rt #127906) #2702

Open
raiph opened this issue Feb 17, 2019 · 1 comment
Open
Labels
regex Regular expressions, pattern matching, user-defined grammars, tokens and rules

Comments

@raiph
Copy link
Contributor

raiph commented Feb 17, 2019

Shifting bug here with new info from 2016 rt issue: https://rt.perl.org/Public/Bug/Display.html?id=127906

I haven't closed the rt bug yet. I can no longer login to rt. Can I close a bug via email? If so, how? TIA.

v2018.12

my @array = < a ab >;
say 'abc' ~~ /  |< a ab >    b /;  # ab
say 'abc' ~~ /  |@array      b /;  # Nil (expected ab)
say 'abc' ~~ /  |@(< a ab >) b /;  # Nil (expected ab)
say 'abc' ~~ / ||< a ab >    c /;  # abc
say 'abc' ~~ / ||@array      c /;  # Nil (expected abc)
say 'abc' ~~ / ||@(< a ab >) c /;  # Nil (expected abc)
@raiph raiph changed the title Regex: Array interpolation depends on order of array elements (in [REGEX] @ symbol'd array interpolation doesn't backtrack (from rt #127906) Feb 17, 2019
@raiph
Copy link
Contributor Author

raiph commented Feb 17, 2019

After golfing https://rt.perl.org/Public/Bug/Display.html?id=126713 I believe it boils down to a duplicate of this bug:

my @a = < a b bc cd >;
say "abcd" ~~ /^( < a b bc cd > )*?$/; # 「abcd」 etc.
say "abcd" ~~ /^( @a            )*?$/; # Nil

Thus it should be annotated and closed as such.

@lucasbuchala lucasbuchala added the regex Regular expressions, pattern matching, user-defined grammars, tokens and rules label Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regex Regular expressions, pattern matching, user-defined grammars, tokens and rules
Projects
None yet
Development

No branches or pull requests

2 participants