Regular Expression Arabic characters and numbers only

后端 未结 11 987
梦毁少年i
梦毁少年i 2020-11-27 02:44

I want Regular Expression to accept only Arabic characters, Spaces and Numbers.

Numbers are not required to be in

11条回答
  •  死守一世寂寞
    2020-11-27 03:18

    Just add 1-9 (in Unicode format) to your character-class:

    ^[\u0621-\u064A0-9 ]+$
    

    OR add \u0660-\u0669 to the character-class which is the range of Arabic numbers :

    ^[\u0621-\u064A\u0660-\u0669 ]+$
    

提交回复
热议问题