Skip to content
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

Python: Understand multiple parse mode flags specified in a regular expression string #13779

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Jul 20, 2023

Understand / correctly parse multiple parse mode flags specified in a regular expression string, for example i and s in:

(?is)abc.*

Previously we were only recognizing the first flag (i).

This is a backport of part of the Swift PR #13715 .

@geoffw0 geoffw0 added the Python label Jul 20, 2023
@geoffw0 geoffw0 requested a review from a team as a code owner July 20, 2023 11:02
@calumgrant calumgrant requested a review from yoff July 24, 2023 09:08
Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR, good choice of tests. Also, thanks for doing this 🙏

@yoff
Copy link
Contributor

yoff commented Jul 24, 2023

The test failures can be explained by flag_group_start now only matching (? and not also the first mode character.
They do pose the question if mode characters should not be considered normal characters. They do not seem like good candidates for first and last items to be matched...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants