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
re.sub replaces twice #85727
Comments
The following command produced "name.tsvtsv" with version 3.7.1 and 3.8.5 instead of the expected "name.tsv" from version 2.7.5, 3.5.6, and 3.6.7. Changing * to + produced expected "name.tsv". python -c 'import re; v="name.txt";v = re.sub("[^\\.]*$", "tsv", v);print(v)' |
The re.sub() doc said: IMO 3.7+ behavior is more reasonable, and it fixed a bug, see bpo-25054. |
Thanks. But if talking about empty matches, there would be endless empty On Fri, Aug 14, 2020 at 10:37 PM Ma Lin <report@bugs.python.org> wrote:
|
There can be at most one empty match at a position. IIRC, Perl's regex engine has very similar behavior. |
Okay. Thanks. On Sat, Aug 15, 2020 at 9:07 AM Ma Lin <report@bugs.python.org> wrote:
|
Thanks. On Mon, Aug 17, 2020 at 7:40 PM Pablo Galindo Salgado <
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: