Specifies a regular expression the input value must match
Applies to text, password, email, and url types of the input
element, and the textarea
element
Regular expression dialect is same as JavaScript's (ECMA 262)
<form>
<p>
<label>Card number:
<input type="text" name="cardnumber"
pattern='\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d(\d\d\d)?'/>
</label>
</p>
<p>
<label>
<input type="submit" value="Send data" />
</label>
</p>
</form>