-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Hashtag regex doesn't catch Unicode hashtags #4398
Comments
Whoa that is interesting and kind of surprising to me. Lots of info here: I think, this is fixed in ES6 by adding the @mojodna, can you submit a PR with a fix that uses one of the ES5-safe options? |
Thoughts? |
@mojodna That seems fine.. I'm ok with a big ugly regex, as long as the code is readable and commented, something like.. // match unicode range and non punctuation, see #4398
var hashtagRegex = /biguglyregex/;
whatever.match(hashtagRegex); |
Unicode ranges for punctuation are simpler than creating a Unicode-aware word class, so delimit on non-words. Fixes openstreetmap#4398
After 9719a31, Unicode characters (including emoji ;-) in hashtags are no longer included (they're now treated as word separators):
I've been using
/(#[^\d][^#\s,;:]*)/g
as my current regex of choice (with the dubious assumption that hashtags shouldn't start with numbers).The text was updated successfully, but these errors were encountered: