jeudi 16 mai 2019

html5 input pattern that allow like version string

I found out that there is a pattern attribute in input. like this one

<input type="text" name="version" 
pattern="[A-Za-z]{3}" title="Game Version">

I was thinking to put a version pattern but I have no idea what the regex for it. the ideal pattern format is like this nnn.nnn.nnn. I know it is possible but I have no idea how to do it here? I need help for that.

the field must allow these:

1.2.3
12.12.12
123.123.123

thanks

Aucun commentaire:

Enregistrer un commentaire