简体   繁体   中英

HTML5 pattern for input(mask)

( (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!

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> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM