Regular expression to match ASCII and Unicode letters

Thomas picture Thomas · Dec 10, 2010 · Viewed 9.6k times · Source

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?

Answer

Tim Down picture Tim Down · Dec 10, 2010

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