Created
June 17, 2012 15:33
-
-
Save padolsey/2944861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ALPHA = 'abcdefghijklmnopqrstuvwxyz', | |
ALPHA_UPPER = ALPHA.toUpperCase(), | |
NUMERIC = '0123456789', | |
PUNCTUATION = '-!@£$%^&*()[]{}\'"/?.>,<;:\\|~`€#', | |
UNDERSCORE = '_', | |
WHITESPACE = '\x20\t\n\r\f\v\xa0\u2028\u2029\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff'; // thanks Mathias! | |
var SHORTHAND_CC = { | |
'\\S': ALPHA + ALPHA_UPPER + NUMERIC + PUNCTUATION + UNDERSCORE, | |
'\\s': WHITESPACE, | |
'\\W': NUMERIC + PUNCTUATION + UNDERSCORE, | |
'\\w': ALPHA + ALPHA_UPPER + NUMERIC + '_', | |
'\\d': NUMERIC, | |
'\\D': ALPHA + ALPHA_UPPER + PUNCTUATION + UNDERSCORE + WHITESPACE | |
}; |
@mathiasbynens, I wasn't sure where to find that, so thank you! I think my PUNCTUATION
is missing a bunch too, but I think it's enough for basic generations.
This project moved here: https://github.com/padolsey/rGen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like where this is going!
FWIW,
WHITESPACE
is[\x20\t\n\r\f\v\xa0\u2028\u2029\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]
as per ES 5.1.http://es5.github.com/x15.10.html#x15.10.2.12:
http://es5.github.com/x7.html#x7.2: