I observed that when using the re2 Python bindings, $ replaces the end of the string twice.
What is the current behavior?
This test case fails with the result being "Hello WorldEOSEOS".
import re2
def test_re2_dollar_sign():
end_of_string = re2.compile("$")
(result, matches) = end_of_string.subn("EOS", "Hello World")
assert result == "Hello WorldEOS"
assert matches == 1
What is the desired behavior?
The result should be "Hello WorldEOS".
I'm using google-re2 in version 1.1.20251105 and Python version 3.11.2.