Regular expression for arabic numbers

I have this form, which has jQuery validation function, I have a problem with the phone field, all I want is for users to enter numbers ... Its work works fine in English, but in Arabic, if I enter numbers using Arabic, the form will not be submitted. Does anyone know what a regular expression is for arabic numbers?

+8
jquery html regex validation arabic
source share
3 answers

Try the following:

/[\u0660-\u0669]/ 

Example:

 var arNumbers = '٠١٢٣٤٥٦٧٨٩' ,reg_arNumbers = /^[\u0660-\u0669]{10}$/; if (reg_arNumbers.test(arNumbers)) alert("10 Arabic Numerals"); else alert("Non-Arabic Numerals"); 
+15
source share

This is most likely the result of unicode and ASCII - the regular expression should be trivial otherwise.

0
source share

You can use [^[:digit:]] .

This will return any digit no matter what language, including mixed languages

0
source share

All Articles