-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
expose re._parse.parse_template publicly #105636
Comments
Refs #105456 |
I started working on this and added
Considering the very limited amount of documentation about this function, I would appreciate some help in testing it thoroughly and writing detailed documentation. |
Is regex replacement template validation only what you need? Or do you need more information from the result? Over a year ago, I wrote an implementation to compile a regex replacement template. I expected that this could be used to speed up critical code, like |
personally I only care about validation |
Since the I think it is redundant to implement a function just to check if a replacement template is valid, instead we could use the existing one as it is. |
Feature or enhancement
I would like to access
parse_template
to be able to eagerly validate that a regex replacement template is valid.I'm using this in my python-based text editor to do find and replace. Currently I am reaching into
sre_parse
to getparse_template
(which used to be a public-named module but was deprecated in 3.11)I suspect this could be as simple as exposing
parse_template
-- my code doesn't actually care about the return value, simply whether it raises an exception or notThe text was updated successfully, but these errors were encountered: