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.
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.
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:
/^[\x20-\x7E]+$/
Results
This would match (English): I love you
This would match (French): Je t'aime
This would not match (Japanese): 愛している