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
() vs [] influences matching behavior #3703
Comments
From beasley@web.desay "asdfEnd" ~~ /:ratchet ( xyz || .+! ) End / say "asdfEnd" ~~ /:ratchet [ xyz || .+! ] End / I'd expect them to give the same result. |
From @smlsSimpler test-case: say "abcd" ~~ /:ratchet .+! "d" /; # 「abcd」 I think this may actually not be a bug. One thing that is slightly surprising, though, is that the following still matches: say "abcd" ~~ /:ratchet ["foo" || .+!] "d" /; # 「abcd」 S05 suggests that :ratchet should prevent backtracking into an alternation: The new :r or :ratchet modifier [...] imply a : after every atom, including [...] alternations. Does that only refer to declarative alternations with `|`, and not to sequential ones with `||` ? |
The RT System itself - Status changed from 'new' to 'open' |
From @smlsTurns out there is already ticket #123934 for the question of whether both `|` and `||` style alternations should be affected by the :ratchet modifier. So *this* ticket can be reduced to the question of whether the following two should behave the same as far as matching is concerned:
As I stated in my previous comment, I'm not convinced they should. |
Migrated from rt.perl.org#123933 (status was 'open')
Searchable as RT123933$
The text was updated successfully, but these errors were encountered: