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

True case insensitive regex support #2314

Merged
merged 1 commit into from Feb 16, 2022
Merged

True case insensitive regex support #2314

merged 1 commit into from Feb 16, 2022

Conversation

DampToast
Copy link
Contributor

It looks like regular expressions and filenames both were having strings.ToLower applied to them. There are many special meta-sequences in regex that are upper case and converting them to lower case reverses them. For instance \D means any non-digit character and the current code was converting it to \d meaning any digit.

To fix this I now prepend (?i) to the beginning of any regex that does not have (?i) at the start already. This maintains the case insensitivity while allowing uppercase meta-sequences to be used.

I also added some test cases to ensure the functionality.

@kermieisinthehouse kermieisinthehouse added this to the Version 0.13.0 milestone Feb 14, 2022
@kermieisinthehouse kermieisinthehouse added the improvement Something needed tweaking. label Feb 14, 2022
@WithoutPants WithoutPants added bug Something isn't working and removed improvement Something needed tweaking. labels Feb 16, 2022
@WithoutPants WithoutPants merged commit de2724a into stashapp:develop Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants