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
Interpolation of /<$var>/ causes incorrect matches when $var contains alternation. #3316
Comments
From @UtilInterpolation of /<$var>/ causes incorrect matches when $var contains alternation. 2014-01-17 15:22-15:45 < Util> Adding 'z|' to the front of the pattern causes crazy matches, but only when the string pattern is interpolated into a re. < ingy> Util: can you serialize the regex after string interp? < FROGGS> p: my $r = "z|ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/ < FROGGS> it is like it still matches "tttaacct", but then forgets the position where the match started < FROGGS> p: my $r = "e||tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/ < FROGGS> it fails because it needs a group < Util> That might give me a workaround, but the current behavior is still a bug, IMO. 2014-01-17 18:49-18:52 -- |
From @usev6FWIW the first two evaluations give identical results now: $ perl6 -e 'my $s = "abcdefghtttaaccta"; my @pats = /ttta<[agt]>cct/, /z|ttta<[agt]>cct/; for @pats -> $pat { say $s.comb( /$pat/ ); }' $ perl6 -e 'my $s = "abcdefghtttaaccta"; my @pats = "ttta<[agt]>cct", "z|ttta<[agt]>cct"; for @pats -> $pat { say $s.comb( /<$pat>/ ); }' |
1 similar comment
From @usev6FWIW the first two evaluations give identical results now: $ perl6 -e 'my $s = "abcdefghtttaaccta"; my @pats = /ttta<[agt]>cct/, /z|ttta<[agt]>cct/; for @pats -> $pat { say $s.comb( /$pat/ ); }' $ perl6 -e 'my $s = "abcdefghtttaaccta"; my @pats = "ttta<[agt]>cct", "z|ttta<[agt]>cct"; for @pats -> $pat { say $s.comb( /<$pat>/ ); }' |
@usev6 - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#121024 (status was 'open')
Searchable as RT121024$
The text was updated successfully, but these errors were encountered: