Search code examples
javascriptregexcharacter-properties

Regular expression to match ASCII and Unicode letters


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?


Solution

  • I'd recommend Steven Levithan's excellent XRegExp library, which has a Unicode plugin containing various Unicode character classes: http://xregexp.com/plugins/