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
~ operator in regexp reverts capture order, but it should not #2129
Comments
From @bbkr[17:29] <bbkr> rakudo: say so "abc" ~~ /a ~ (c) (b)/; say $0 |
From @bbkr[12:14] <bbkr_> nom: say so "abc" ~~ /a ~ (c) (b)/; say $0 # this is |
The RT System itself - Status changed from 'new' to 'open' |
From @cokeOn Thu Aug 25 03:17:17 2011, bbkr wrote:
Current nom behavior:
-- |
From @FROGGSwhat exactly is wrong? FROGGS> r: say so "abc" ~~ /a ~ (c) (b)/; say $/ It's 'b' surrounded by 'a' and 'c'. And since b is in the middle it is Star matches the same. |
From @bbkr<masak> bbkr__: definitely a bug. |
From @usev6Current behaviour:
As I understand S05 the ~ operator basically rewrites the above regex to /a (b) (c)/ and only then matching and capturing happens. So the question seems to be, whether numbering of subpatterns should be done before the regex is rewritten or afterwards. Rakudo seems to do the latter while it should be the former. (Please correct me if that's not the point. I'm trying to rephrase the bug report to avoid any confusion.) |
1 similar comment
From @usev6Current behaviour:
As I understand S05 the ~ operator basically rewrites the above regex to /a (b) (c)/ and only then matching and capturing happens. So the question seems to be, whether numbering of subpatterns should be done before the regex is rewritten or afterwards. Rakudo seems to do the latter while it should be the former. (Please correct me if that's not the point. I'm trying to rephrase the bug report to avoid any confusion.) |
From @FROGGSThe capture order is meant to be how *you* read the regex from left to So it is meant to capture c first. |
From @masakChristian Bartolomaeus (>):
Sounds right to me. The number of the capture group should depend on |
From @usev6Thanks for the feedback. I added a fudged test to S05-metachars/tilde.t with the following commit: Raku/roast@f15d9aed26 |
1 similar comment
From @usev6Thanks for the feedback. I added a fudged test to S05-metachars/tilde.t with the following commit: Raku/roast@f15d9aed26 |
From @jnthnOn Wed Sep 01 08:34:47 2010, pawel.pabian@implix.com wrote:
Fixed this, and also unfudged the test in S05-metachars/tilde.t. |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#77616 (status was 'resolved')
Searchable as RT77616$
The text was updated successfully, but these errors were encountered: