unicoderegexp
Various regular expressions for unicode character classes (letter, punctuation, number, etc.) and helper functions for composing them.
Used by the purify library.
The module exports a bunch of useful RegExps each with a single character class in them:
letter
mark
number
punctuation
symbol
separator
other
visible
printable
unicodeRegExpvisible; // trueunicodeRegExpvisible; // falseunicodeRegExpvisible; // false -- a non-breaking space is not visible
To validate an entire string you need to build a new RegExp:
var visibleStringRegExp = '^' + unicodeRegExpvisiblesource + '*$';visibleStringRegExp; // truevisibleStringRegExp; // false because of the space unicodeRegExp; // /[\u00f8\u00e5]/unicodeRegExp; // /[a-bc-d]/
The info about which characters belong to which classes was taken from the XRegExp library and its Unicode plugin.