Q: Lonely surrogates and unicode regexps

Marja Hölttä marja at chromium.org
Wed Jan 28 08:27:41 PST 2015

Cool, thanks for clarifications!

To make sure, as per the "intended semantics", we never allow splitting a
valid surrogate pair (= matching only one of the surrogates but not the
other), and thus we'll differ from the Java implementation here:

/foo(.+)bar\1/u.test("foo\uD834bar\uD834\uDC00"); we say "false", Java says

(In addition, /^(.+)\1$/u.test("\uDC00foobar\uD834\uDC00foobar\uD834") ==
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150128/f16fa62d/attachment.html>

More information about the es-discuss mailing list