-
Notifications
You must be signed in to change notification settings - Fork 444
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
backreference tries to match impossible capture names. #399
Comments
This is expected behavior. In fact, this particular case is even called out explicitly in the documentation: https://docs.rs/regex/0.2.2/regex/struct.Captures.html#method.expand --- It even tells you how to fix it. :-) If you're not reporting this as a bug but instead a feature request, then I think I'd disagree. I'd rather stick to simple rules. |
Okay. :) I raised it as a bug. |
Sorry about confusing topic - below fragment should be self explanatory.
I think the replace should see the capture name $1 since Q is not a number. Especially that you are not allowed to create a capture names starting with numbers see this error message:
This works as I expected in sed and notepad++.
The text was updated successfully, but these errors were encountered: