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
regexes doc doesn't mention $/ backreferences inside regex #1545
Comments
|
In particular, the docs don't say that you can't refer to an already-matched thing that has just been matched unless you force the named matches to update with |
|
not only numbered matches, but also named matches. probably only references to $/ that are part of pieces of code, like |
|
Let me see if I can come up with an example for this, as well as a reasonable use case. |
|
I don't think I really understand what you propose. say "zipi zape" ~~ /(\w)\w» \s+ \w+({$/})/;This matches, but returns an empty match in the second case. Same if you use say "zipi zape" ~~ /(\w){}\w» \s+ \w+({$/})/;Does not make any difference. This does not either say "zipi zape" ~~ /(\w){ $/ = $0 }\w» \s+ \w+({$/})/;So what are you exactly proposing here? |
|
We need to fix #2887 before this one. |
Not only is it important to know how exactly to refer back to already-matched things (though it's very simple in perl6), but it's very important to know that
$/only updates whenever a{ }is encountered or when aregex { }or similar is finishedThe text was updated successfully, but these errors were encountered: