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
Literal array interpolation in regex doesn't match as expected. #4779
Comments
From @peschwaConsider the following two regexen and their matching output, or lack thereof: 11:39 < psch> m: say "abcd" ~~ /^(a | b | bc | cd)*?$/; my @a = < a b bc cd >; say "abcd" ~~ /^(@a)*?$/ S05 says: An interpolated array: / @cmds / is matched as if it were an alternation of its literal elements. Ordinarily it matches using junctive semantics: / [ Taking this literal still matches when written as the long form: 11:51 <psch> m: my @a = < a b bc cd >; say "abcd" ~~ /^( With the S05 quote I'd expect the array to interpolate into any of the two other regexen and produce the same match. |
From @peschwaOn Mon Nov 23 03:52:55 2015, peschwa@gmail.com wrote:
03:39 < Juerd> psch: In bug reports I try to read significance in every character. So given ^(@a)*?$ I wonder why it's anchored, and why there's a ? after the * |
From @peschwaOn Sat Dec 19 19:44:53 2015, peschwa@gmail.com wrote:
19:24 < psch> m: my @a = < a b bc cd >; say "abcd" ~~ /^([||@a])*?$/ |
From [Unknown Contact. See original ticket]On Sat Dec 19 19:44:53 2015, peschwa@gmail.com wrote:
19:24 < psch> m: my @a = < a b bc cd >; say "abcd" ~~ /^([||@a])*?$/ |
Migrated from rt.perl.org#126713 (status was 'new')
Searchable as RT126713$
The text was updated successfully, but these errors were encountered: