dimanche 17 avril 2016

Value for Pattern Attribute for Input Field like words "Kim", "Kim Sun", "Kim 2" etc

Words start with minimum 3 letters and then may be a white space and numbers, say "Kim", "Kim Sun", "Kim 2" etc. In this case, what should be the value for pattern attribute for html input field?

I have a working regex for php for the same purpose "/^[a-zA-Z]{3,}[a-zA-Z0-9 ]+$/i". I tried from this as pattern="[a-zA-Z]{3,}[a-zA-Z0-9 ]". But it is not working.

Aucun commentaire:

Enregistrer un commentaire