I'm using the Html5 pattern to validate my inputs on forms. I need to make sure an input has the following rules:
Eg. wrx12345
Can I even do this with pattern or do I need to use JavaScript?
I believe the regex pattern you are looking for is /^wrx[0-9]{5}$/. A visual representation of this here:
/^wrx[0-9]{5}$/
And implemented in html:
<input name="example" pattern="^wrx[0-9]{5}$">
2.1m questions
2.1m answers
60 comments
57.0k users