-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add tests for #9306 #9315
Comments
What are the odds this pops up again? Close to zero, hence I didn't add tests. |
Unfortunately 8ab6fa1 fixes only part of the issue #9306: import re
echo replace("bar", re"^", "foo")
echo replace("foo", re"", "-") both replacements still end in an infinite loop instead of producing:
and: import re
echo "".replacef(re"([^\d]*)(\d*)([^\w]*)", "$1 - $2 - $3") produces no output, but using nre and in other languages (Perl, Gawk, Python, JavaScript, ruby, elixir, erlang) equivalent code produces:
i.e. 3 zero-length matches resulting in empty-string captures. |
Thanks for your work on this issue! import re
echo replace("foo", re"", "-") produces: import nre
echo replace("foo", re"^|$", "-") which produces import re
echo "".replacef(re"([^\d]*)(\d*)([^\w]*)", "$1 - $2 - $3") still produces an empty line, which doesn't seem correct, I would expect import re
echo "abc123###".replacef(re"([^\d]*)(\d*)([^\w]*)", "$1 - $2 - $3") correctly produces: |
Now that you know by my commits how to fix/touch |
#9306 got fixed in 8ab6fa1 but tests need to be added.
The text was updated successfully, but these errors were encountered: