-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
have a way to search backwards for re #36095
Comments
There doesn't seem to be any reasonable way to search I propose adding a direction flag to the search function r = re.compile(...)
m = re.search(str, startpos=5000, endpos=-1, dir=-1) would search in str for r, starting at This is useful in (for example) text editors where phr |
Logged In: YES Moved to feature requests tracker. |
Logged In: YES Another way to do this would be add a direction flag to the group = re.search(pat, str, start, end, re.R) or something like that. I continue to want this feature. It's very handy for writing |
Does this request still stand? I'm working on the re module at the moment. |
Why not? I needed such a feature some time ago. |
Implemented as part of bpo-3825. |
Hello, I wanted to use this feature and found this issue. It is marked as closed, being a duplicate of another closed issue. However the feature is actually not present. In 2008 it was planned to be added by Matthew Barnett in bpo-3825, but the work of improving re module moved to bigger project under bpo-2636 which resulted in regex package to be evenually included in stdlib. So unless regex is included in stdlib, one should try regex package (e.g. pip install regex). I've put here this summary just in case there is someone like me who looked for the feature and found this issue. |
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: