Reputation: 173
( (0)|(\d{1,3})([\,])(\d{2}))
we would like get pattern for pattern 0
or number format ***,**
in input, where * is number.
But we cann't find options for this regexp .
How syntax will be right in this case?
Thanks!
Upvotes: 1
Views: 6651
Reputation: 174957
The space at the beginning is what's causing you trouble.
<form action="foo.html">
<input type="text" required pattern="((0)|(\d{1,3})([\,])(\d{2}))" />
<button>Submit</button>
</form>
Upvotes: 2