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
Regex start of string replace seems to be repeatedly applied #8402
Labels
Comments
Thanks for the report, I can confirm the issue. The problem is that the A slightly more complicated example of the issue, showing that it's not simple to solve: >>> re.sub('(^ab|cab)', '0', 'abababcabab')
'00000' |
Also similar issue for print(re.compile('^ab').split('abababcabab'))
['', '', '', 'cabab'] |
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Mar 10, 2022
Fixes issue micropython#8402. Signed-off-by: Damien George <damien@micropython.org>
I found a relatively simple fix; see #8403. |
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Mar 16, 2022
Fixes issue micropython#8402. Signed-off-by: Damien George <damien@micropython.org>
Fixed by 63f0e70 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In MicroPython on ESP32 (v1.18 release and v1.18-202-gade2720e5).
Start-of-string
^a
regex insub
acts like it's applied repeatedly in some way.In C Python we get the expected result:
The text was updated successfully, but these errors were encountered: