add support for unicode regexes - closes #11

This commit is contained in:
Sebastian McKenzie
2014-10-09 14:24:04 +11:00
parent 66b347576c
commit 21f039e775
6 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
var string = 'foo💩bar';
var match = string.match(/foo(.)bar/u);

View File

@@ -0,0 +1,2 @@
var string = 'foo\uD83D\uDCA9bar';
var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]))bar/);