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 'regex' module support #1405

Open
OnlineCop opened this issue Oct 29, 2020 · 4 comments
Open

Python 'regex' module support #1405

OnlineCop opened this issue Oct 29, 2020 · 4 comments

Comments

@OnlineCop
Copy link
Collaborator

This may be a duplicate of #1219.

I see multiple issues being opened regarding Python syntax: #1271, #1403, #1404.

Should we offer users who choose Python as the flavor, a choice to select either the re or the regex modules?

regex is backward-compatible with re but extends many of the PCRE features, like inline flags, \K, recursion, etc.

@firasdib
Copy link
Owner

firasdib commented Feb 4, 2021

Wouldn't their need be filled by simply using the PCRE flavor?

@OnlineCop
Copy link
Collaborator Author

Mostly, yes, but if PCRE were selected as the flavor, the Code Generator is using the re module instead of the regex module when you change to the Python language.

Most of those advanced features are supported under the regex module, so we might want to change re for regex when the Flavor is PCRE and the Code Generator language is set to Python.

@Doqnach
Copy link
Collaborator

Doqnach commented Mar 9, 2021

Possible alternative is to have multiple code generators for Python? (2 vs 3, re vs regex)

@genericusername3
Copy link

genericusername3 commented Nov 30, 2021

Wouldn't their need be filled by simply using the PCRE flavor?

No, actually. In contrast to PCRE, the regex module supports variable-width lookbehinds, for instance (like ECMAScript, but the named group structure in ECMA is (?<name>pattern) instead of (?P<name>pattern))

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

No branches or pull requests

4 participants