Skip to content

Align RegexRpl API with the re/regex one#387

Merged
priv-kweihmann merged 1 commit into
priv-kweihmann:mainfrom
michalsieron:align-regex-api
Jun 18, 2026
Merged

Align RegexRpl API with the re/regex one#387
priv-kweihmann merged 1 commit into
priv-kweihmann:mainfrom
michalsieron:align-regex-api

Conversation

@michalsieron

Copy link
Copy Markdown
Contributor

While analyzing some parsing issues I noticed the regex.MULTILINE flag in parser.py doesn't really change anything, as it is treated as a value for positional timeout argument. As things did work with flag not being applied let's drop it.

While at it I aligned the API to match upstream re/regex modules.

@priv-kweihmann priv-kweihmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good catch, but even if flag didn't do anything apparently, I would like to keep the MULTILINE flag in this case,
even if it's just for highlighting the expectations (of handling multiline input) in comparison to others that don't use the flag

@priv-kweihmann

Copy link
Copy Markdown
Owner

In addition this PR is missing an updated API doc - please regenerate that one according to the docs provided by the readme

Due to API mismatch one could provide regex flags that would be treated
as the timeout value instead.
To prevent that and other mistakes let's align the API with normal
re/regex modules.

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>

@priv-kweihmann priv-kweihmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for this PR

@priv-kweihmann priv-kweihmann merged commit 1eae5e5 into priv-kweihmann:main Jun 18, 2026
5 checks passed
@michalsieron michalsieron deleted the align-regex-api branch June 18, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants