-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Replace with optional matching group fails when there is no match #31456
Comments
Upstream issue? |
I think this bug still exists in Julia 1.6. It seems to be related to using
|
The PR #31493 seems to have stalled Though, in this example, I'm not sure why you wouldn't mark the capture as an optional match of a required group
|
I'm happy to pick it up where it stalled, just wasn't sure whether it was appropriate, thanks for the feedback there Re the example, it's a slight modification from the docs (see https://discourse.julialang.org/t/replace-with-non-matching-group/22187), fair enough there's a workaround but this should still be fixed I think. |
This is a repost from my question on discourse but I'm reasonably sure it's a bug so opening here. Everything below is ran with the most recent 1.2 binary on mac FWIW.
What fails:
Stacktrace:
Note this example is adapted from the doc of
replace
just changingfoxes
(in the doc) forfox
. So in this case the optional matching group does not match which is what the error says about\1
not being set. The expected behaviour should be to just get"The quick bus run quickly."
i.e. the\1
should be injected with an empty string, I think.FWIW, using Python 3.7:
The text was updated successfully, but these errors were encountered: