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

case insensitive match not working #30

Closed
mschoch opened this issue Jun 7, 2019 · 2 comments
Closed

case insensitive match not working #30

mschoch opened this issue Jun 7, 2019 · 2 comments

Comments

@mschoch
Copy link
Contributor

mschoch commented Jun 7, 2019

First reported to me by @aviadl, it appears that case-insensitive matching was not working.

We should be able to write regexes like (?i)marty and match marty, MARTY and mArTy among others.

When I first reviewed the code (and the rust version it was based on) it appeared that this was intended to work. See: https://github.com/couchbase/vellum/blob/master/regexp/compile.go#L71

But, looking at the impl it was clearly wrong. It detected that we wanted case-insensitive match, but proceeded to build a state machine with the single case. The rust version called a separate case_fold method on the character class, which added the other cases. Ours didn't have that method, and also seemed not be correctly ranging over all runes when case-insensitive was requested.

I have a potential fix coming, once I remember how gerrit works.

@mschoch
Copy link
Contributor Author

mschoch commented Jun 7, 2019

Code review here: http://review.couchbase.org/#/c/110383/

@mschoch
Copy link
Contributor Author

mschoch commented Sep 1, 2020

Closing this as the fix was merged a while back.

@mschoch mschoch closed this as completed Sep 1, 2020
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

1 participant