I am trying to write a Reg Expression to check if the Language is English or Arabic.
My field under test is used to capture SMS messages. The message can be in
English with numbers & special characters
OR
Arabic with English numbers/Arabic numbers & special characters
Search should be on multiline accepting space & enter. Check is to allocate the numbers of characters permissible per language. Eg: English allows 160; while Arabic allows only 70 per SMS
I assume the Exp should only check the words (first few to decide the language)
here is a sample of what I wrote in JavaScript; Regex did not work, only RegExp :
var pat = new RegExp("^[A-Za-z0-9\s!@#$%^&*()_+=-`~\\\]\[{}|';:/.,?><]*$");
But for the below string it fails :
"Hello & Hi"
Any suggestions?