Search code examples
htmldesign-patternsarabicletters

HTML pattern Arabic letters


I want to insert the Arabic letters in the pattern just like the English letters

pattern="[a-zA-Z0-9-_. ]{1,30}"

I have no idea how to accomplish the action.


Solution

  • The range for Arabic and Persian are shared so this code could be used for Arabic too.

    [أ-يa-zA-Z]
    

    This is the reference for finding the character range of Unicode languages:

    preg_replace and preg_match arabic characters

    http://unicode.org/charts/