This question asks how to match if any characters in a string are arabic; fair enough, the solution works. I want to know how I can figure out if ALL characters in a string (minus whitespace) are arabic.
The solution says
According to Wikipedia, Arabic characters fall in the Unicode range 0600 - 06FF. So you can use a regular expression to test if the string contains any character in this range:
var arabic = /[\u0600-\u06FF]/;
var string = 'عربية'; // some Arabic string from Wikipedia
alert(arabic.test(string)); // displays true
How can I get var arabic = /[\u0600-\u06FF]/;
to match all characters and not just check for one character?
I am looking for a regex statement that I could use to match against a string, and its return value would indicate whether or not all the characters in a string are arabic characters.
var arabic = /[\u0600-\u06FF]/;
<-- This is a regex statement when, when matched against a string, will indicate if any (one or more) of the characters in said evaluated string have arabic.
The solution I came up with is, ^[\u0600-\u06FF]{1,}$
. I don't know if this is best, I'm not regex savvy, hopefully someone who needs it can see it.