Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

angular - At least 3 words or more but in Arabic [HTML Pattern]

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

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">
question from:https://stackoverflow.com/questions/65848586/at-least-3-words-or-more-but-in-arabic-html-pattern

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is the regex you are looking for : (?:[u0600-u06FF]+ ){2,}[u0600-u06FF]+

For Arabic characters you have to use Unicode, or you can use the letter itself like this : [?-?]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...