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

Default matcher callback's regex will not match mixed ascii + non-ascii characters #562

Open
dixon opened this issue Aug 1, 2018 · 0 comments

Comments

@dixon
Copy link

dixon commented Aug 1, 2018

First, just want to thank you for such an amazing library!

Some of our users have mixed ascii and non-ascii characters in their names, e.g. Sᴀᴜʟ123, which makes the DEFAULT_CALLBACKS.matcher function's regex fail, as it will either match all ascii or all non-ascii:

regexp = new RegExp "#{flag}([A-Za-z#{_a}-#{_y}0-9_#{space}\'\.\+\-]*)$|#{flag}([^\\x00-\\xff]*)$",'gi'

I've overridden this callback for now with this regex: /(?:^|\s)@((?:([A-Za-zÀ-ÿ0-9_'.+-]|[^\x00-\xff]))*)$/, which combines the two character classes into a single capturing group.

Is there a specific reason that ascii and non-ascii groupings should be considered separate?

Again, thank you for all your work on this project :)

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