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

Support astral \u{...} outside of character classes without native /u #110

Open
slevithan opened this issue Sep 30, 2015 · 0 comments
Open

Comments

@slevithan
Copy link
Owner

slevithan commented Sep 30, 2015

XRegExp 3.0.0 introduced support for ES6's \u{...} syntax in all browsers, but requires native flag u if this syntax is used for astral code points--i.e. above \u{FFFF}. However, it would not require much work to support astral \u{...} outside of character classes using surrogate pairs. You'd simply need to generate the surrogate pair and wrap it with (?: ). The wrapping would allow it to work as expected with following quantifiers.

Unfortunately, an error would still need to be thrown if astral \u{...} is used within character classes and the regex does not use native u.

Con: Syntax that works only outside of character classes has potential to cause confusion or frustration.

@slevithan slevithan added this to the v3.1.0 milestone Sep 30, 2015
@slevithan slevithan removed this from the v3.1.0 milestone Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant