I want to put validation on a textbox which doesnt allow to enter any langugae character except english.For ex. Japanese cannot be entered in textbox.
Pls let me know know if you have any regex for this task.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not possible to test for English only but you can test for ASCII characters only, as listed here: http://en.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange#ASCII_printable_characters
This regex should work, as it only allows characters from 0x20 to 0x7E inclusive:
Results
This would match (English): I love you
This would match (French): Je t’aime
This would not match (Japanese): 愛している