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

Adds package manager, unit-testing and exposed look-around limitation #9

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

Conversation

aekasitt
Copy link

I took the liberty to extend the project with uv as package manager because I wanted to run tests on the project using pytest as a development dependency.

I did so, and created a uv.lock file as well as tests directory where the tests are. The unittests are AI-generated and it allowed for me to find the following error, which breaks compatibility between python's re and this project.

error: look-around, including look-ahead and look-behind, is not supported

 tests/search.py:149: in test_regex_compile_and_search
    pattern: module.Pattern = module.compile(arguments["pattern"])  # type: ignore
E   ValueError: regex parse error:
E       ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$
E        ^^^
E   error: look-around, including look-ahead and look-behind, is not supported
__________________________________________________________________________ test_regex_compile_and_search[arguments26-flpc] ___________________________________________________________________________
tests/search.py:149: in test_regex_compile_and_search
    pattern: module.Pattern = module.compile(arguments["pattern"])  # type: ignore
E   ValueError: regex parse error:
E       ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$
E        ^^^
E   error: look-around, including look-ahead and look-behind, is not supported

Let me know if this is something you would like to pursue further, would love to help.

@itsmeadarsh2008
Copy link
Owner

itsmeadarsh2008 commented Jan 21, 2025

error: look-around, including look-ahead and look-behind, is not supported by the regex crate
Also, thanks for taking some time to write tests for it. I'll take a look back if this becomes necessary
rust-lang/regex#841 (comment)

@aekasitt
Copy link
Author

Thank you for your great work. Whichever way you decide, I think the base work was very easy to navigate and extend.

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