I am trying to make a regex that only allows chars A-Z
+ ints 0 - 9
together with dash - and underscore _ but also Japanese chars.
$.validator.addMethod("alphaDash", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9-_]+$/i.test(value);
}, "Username must contain only letters, numbers, dashes or underscores.");
The regex above /^[a-zA-Z0-9-_]+$/
only works for english chars, how can I make it accept japanese chars? Hiragana/Katakana/Kanji