We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/./u
/[^x]/u
Reported by Marja Hölttä:
var string = '𝌆𝌆'; var match = string.match(/(....)/u); console.log(match[1]); I checked that the same behavior occurs for other character classes too, like this: var string = 'a𝌆b'; var match = string.match(/a([^c][^c])b/u); console.log(match[1]); // 𝌆 And as a bonus, it transforms /(.+)\1/u to this: > r = /((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF])+)\1/ > r.test('𝜆𝌆𝌇') // code units: D835 DF06 D834 DF06 D834 DF07 true …which is pretty surprising :)
var string = '𝌆𝌆'; var match = string.match(/(....)/u); console.log(match[1]);
I checked that the same behavior occurs for other character classes too, like this:
var string = 'a𝌆b'; var match = string.match(/a([^c][^c])b/u); console.log(match[1]); // 𝌆
And as a bonus, it transforms /(.+)\1/u to this:
/(.+)\1/u
> r = /((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF])+)\1/ > r.test('𝜆𝌆𝌇') // code units: D835 DF06 D834 DF06 D834 DF07 true
…which is pretty surprising :)
The text was updated successfully, but these errors were encountered:
To match lone surrogates only: https://gist.github.com/mathiasbynens/bbe7f870208abcfec860
Sorry, something went wrong.
c06e868
.
su
No branches or pull requests
Reported by Marja Hölttä:
The text was updated successfully, but these errors were encountered: