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

over 32 characters #38

Closed
elijahdorman opened this issue Oct 28, 2014 · 4 comments
Closed

over 32 characters #38

elijahdorman opened this issue Oct 28, 2014 · 4 comments
Labels

Comments

@elijahdorman
Copy link

Is there a reason for not switching algorithms at 33 characters to an exact match algorithm? It would be seemless to the user and improve user experience (most people typing that much are wanting a fairly exact match anyway).

As it stands in my current project, I have to deal with the error by checking the length and falling back to str.indexOf(searchStr) each time. Building this in seems much more desirable.

@krisk
Copy link
Owner

krisk commented Oct 30, 2014

For clarification, are you referring to the maxPatternLength, currently defaulted to 32? Hence if the pattern length > maxPatternLength, then you're suggesting to perhaps make it fall back to an indexOf search?

@elijahdorman
Copy link
Author

That is correct.

str.match(new RegExp(searchStr, "ig") might also be a solution, but it would be a lot slower.

@krisk
Copy link
Owner

krisk commented Oct 30, 2014

Ok, I will put in some thoughts on this. Meanwhile, let's make this a feature request. Thanks!

@in2lag
Copy link

in2lag commented Dec 2, 2015

+1, not sure if this project is still alive, but if yes, this would be sweet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants