Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
147
rated 0 times [  150] [ 3]  / answers: 1 / hits: 24766  / 12 Years ago, wed, july 4, 2012, 12:00:00

I want to write a regular expression that matches each word in a sentence:



My regular expression:b(w+)b



Result:
RegExp



While it works well with English Words. It does not work when using Arabic words.
How could I accomplish the same feat for Arabic words?


More From » regex

 Answers
16

Try this:-



function HasArabicCharacters(text)
{
var arregex = /[u0600-u06FF]/;
alert(arregex.test(text));
}


Arabic character set of list



[u0600-u06ff]|[u0750-u077f]|[ufb50-ufc3f]|[ufe70-ufefc]


Arabic script in Unicode:



As of Unicode 6.1, the Arabic script is contained in the following blocks:



Arabic (0600—06FF, 225 characters)
Arabic Supplement (0750—077F, 48 characters)
Arabic Extended-A (08A0—08FF, 39 characters)
Arabic Presentation Forms-A (FB50—FDFF, 608 characters)
Arabic Presentation Forms-B (FE70—FEFF, 140 characters)
Rumi Numeral Symbols (10E60—10E7F, 31 characters)
Arabic Mathematical Alphabetic Symbols (1EE00—1EEFF, 143 characters)


Contents are taken from wikipedia - Arabic script in Unicode


[#84483] Monday, July 2, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
grayson

Total Points: 36
Total Questions: 113
Total Answers: 95

Location: Tonga
Member since Fri, Aug 21, 2020
4 Years ago
grayson questions
;