-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support ES6 /u
flag
#4
Comments
Sounds interesting. Thanks a lot for bringing this up! However, this is nothing I plan to work on in the near future but PullRequests are always welcome. If assistance with the code base on how to maybe implement this is required, please reach out to me at any time. |
In order to implement the @jviereck Any plans to release the parser as a separate npm package (and simply using it as a dependency for regexp.js)? |
Not until now, but sounds good to me. Will take some days until I get to it - feel free to ping me if I forget about it. |
Ping! :) I’ve filed it as a separate issue so it’s easier to keep track of: #6 |
The
/u
flag should enable a special parsing mode in which astral ranges can be used, and surrogate pairs only count as a single symbol (i.e. get matched by.
).See the example here, for example: http://mathiasbynens.be/notes/javascript-unicode#astral-ranges Currently regexp.js fails to parse the regular expression with the emoji ranges because ES5 doesn’t support it. But with the
/u
flag, ES6 will! Here’s a link to the demo page with the example prefilled: http://jviereck.github.io/regexp.js/#regexp=%5B%F0%9F%92%A9-%F0%9F%92%AB%5D&input=%F0%9F%92%AAMore info on the
/u
flag: http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/#RegExpThe text was updated successfully, but these errors were encountered: