Recently I discovered, to my surprise, that JavaScript has no built-in support for Unicode regular expressions.
So how can I test a string for letters only, Unicode or ASCII?
Recently I discovered, to my surprise, that JavaScript has no built-in support for Unicode regular expressions.
So how can I test a string for letters only, Unicode or ASCII?
Share Improve this question edited Oct 19, 2018 at 7:42 LarsH 28k8 gold badges97 silver badges159 bronze badges asked Dec 10, 2010 at 7:44 ThomasThomas 4,71913 gold badges47 silver badges67 bronze badges2 Answers
Reset to default 10I'd remend Steven Levithan's excellent XRegExp library, which has a Unicode plugin containing various Unicode character classes: http://xregexp./plugins/
Recently I discovered, to my surprise, that javascript has no builtin support for unicode regex.
This es to a surprise to me as well because
alert(/\u00B6/.test("¶"));
prints true.