What regular expression do I need to check for some non-latin characters?

Posted by zeckdude on Stack Overflow See other posts from Stack Overflow or by zeckdude
Published on 2010-03-31T06:43:14Z Indexed on 2010/03/31 6:53 UTC
Read the original article Hit count: 287

Filed under:
|
|

I am checking a field if it is Latin Characters or not.

var foreignCharacters = $("#foreign_characters").val();
var rlatins = /[\u0000-\u007f]/;

if (rlatins.test(foreignCharacters)) {
  alert("This is Latin Characters");
} else {
  alert("This is non-latin Characters");    
}

This works well, but I would like to change it so when I enter any non-latin characters, such as chinese characters, along with a space(which is within that range I am using currently) it will still say it is non-latin characters.

How can I change the regular expression I have to do that?

© Stack Overflow or respective owner

Related posts about regex

Related posts about jQuery