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

FIX: Use re.fullmatch for needs_id_regex in need creation #1202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Jul 1, 2024

The regex supplied should be assumed to match the entire string, rather than be a partial match (as is the case currently using re.match).

This is then consistent with the usage of needs_id_regex in:

@chrisjsewell chrisjsewell changed the title FIX: Use fullmatch when checking needs_id_regex in need creation FIX: Use re.fullmatch for needs_id_regex in need creation Jul 1, 2024
@chrisjsewell
Copy link
Member Author

@danwos this now fails our docs build and some tests, because there it appears that regex is assumed to only be partial (only checking the start of the string).

So the question would be, do we instead change the code in needextend and needextract to use re.match, rather than re.fullmatch

@danwos
Copy link
Member

danwos commented Jul 1, 2024

Good point, I guess the user can reach fullmatch by using in the configured regex an ending $ right?
So yes, we should change it then also to match for needextend and co.

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.

None yet

2 participants