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

Regular Expression Parsing (non case insensitive) #77

Open
m1dst opened this issue Nov 18, 2020 · 1 comment
Open

Regular Expression Parsing (non case insensitive) #77

m1dst opened this issue Nov 18, 2020 · 1 comment

Comments

@m1dst
Copy link

m1dst commented Nov 18, 2020

Hi,

By default, the string parsing for regular expressions is doing case insensitive checks by lowercasing the regex. Is there a reason for this? I am considering making changes to allow regex comparison to me made based on what you supply. EG: ^A\d{1,}.\d{1,}.1.\d{1,}$

If required I will create a pull request but before I do I want to ensure you are happy with the approach.

  • I could create a new property similar to _regex but call it _regexraw and then process accordingly.
  • I could just modify to not lowercase the string at all and let a user apply the /i to the end if they want it to be case insensitive.
  • Something else.

Personally, I think approach 2 (whilst breaking current functionality) is the most logical way forward.

Thoughts?

@deitch
Copy link
Owner

deitch commented Nov 19, 2020

Huh, I am surprised this is happening. The tests actually tests for successful matches of upper-case against an upper-case input, and lower-case with ignore-case against upper-case input, but never tests for failure of lower-case against an upper-case input without ignore-case.

Would be happy to take a PR on this, option 2 makes the most sense to me as well.

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

No branches or pull requests

2 participants