jeudi 13 août 2015

Need to writing a valid regular expression (regex)

I have an input field on my website which uses pattern matching in the HTML It needs to have - Lowercase a-z (not upper) - All numbers (0-9) - Allows underscores (_) but NOT spaces - Minimum of 4 characters with a max of 12. - Does not allow special characters such as @, #, $, %, ^, * etc.

Right now I have pattern="(?=.*[a-z0-9_]).{4,12}" The problem seems to be that it does allow special characters.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire