Skip to content

Instantly share code, notes, and snippets.

@adamstraube
Created March 16, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamstraube/a523379514938083ffc0 to your computer and use it in GitHub Desktop.
Save adamstraube/a523379514938083ffc0 to your computer and use it in GitHub Desktop.
Detect Unicode Chars in JS regex
jQuery.validator.addMethod("alphanumeric", function(value, element) {
return this.optional(element) || /[!^\x00-\x80]+/i.test(value);
}, "Letters, numbers, and underscores only please");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment