I'm trying to make an input that only accept at least 3 words or more, found this ([a-zA-Z]+s){2,}([a-zA-Z]+) but it only accepts English
([a-zA-Z]+s){2,}([a-zA-Z]+)
I need it like the example below but in Arabic
<input required pattern="([a-zA-Z]+s){2,}([a-zA-Z]+)" type="text" name="name">
This is the regex you are looking for : (?:[u0600-u06FF]+ ){2,}[u0600-u06FF]+
(?:[u0600-u06FF]+ ){2,}[u0600-u06FF]+
For Arabic characters you have to use Unicode, or you can use the letter itself like this : [?-?]
[?-?]
2.1m questions
2.1m answers
60 comments
57.0k users