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

Files with UTF8 characters cause false positives #89

Open
skyrpex opened this issue Apr 1, 2022 · 1 comment
Open

Files with UTF8 characters cause false positives #89

skyrpex opened this issue Apr 1, 2022 · 1 comment
Labels
help wanted Extra attention is needed pr welcome

Comments

@skyrpex
Copy link

skyrpex commented Apr 1, 2022

For example, the following file:

Romania (România)

Cause this output:

 Case  Police  v0.3.0

1475 files found for checking

Rom → ROM         ./file
@antfu antfu added help wanted Extra attention is needed pr welcome labels Apr 1, 2022
@holazz
Copy link
Contributor

holazz commented Apr 6, 2022

const regex = new RegExp(`\\b(${keys.join('|')})\\b`, 'gi')

I'm not sure if this is possible.🤔

const regex = new RegExp(`\\b(${keys.map(k => `(?![\u00C0-\uFFFF])${k}(?![\u00C0-\uFFFF])`)})\\b`, 'gi')

This was referenced Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed pr welcome
Projects
None yet
Development

No branches or pull requests

3 participants