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 character isssues #720

Closed
exeba opened this issue Feb 24, 2021 · 1 comment
Closed

Regular expression character isssues #720

exeba opened this issue Feb 24, 2021 · 1 comment

Comments

@exeba
Copy link

exeba commented Feb 24, 2021

Filtering words with a "." or any of these escaped characters:

s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&') // Escape regular expression characters

leads to empty result.
I seems to me that the search string is treated like a regex but them used like a regular string:

if (text.toLowerCase().indexOf(words[i]) !== -1)

Am I missing something?

@exeba
Copy link
Author

exeba commented Feb 24, 2021

Duplicate of #699

@exeba exeba closed this as completed Feb 24, 2021
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