I have a web application related vehicle record, in this application I want to add vehicle number. but client want fix format like box for it ->
RJ 19 NP 5020 please anybody help me for it. thanks!
I have a web application related vehicle record, in this application I want to add vehicle number. but client want fix format like box for it ->
RJ 19 NP 5020 please anybody help me for it. thanks!
Try this regex
^[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}$ Use html pattern with regex like so:
<input type="text" pattern="^([A-HJ-PR-Y]{2,2}[056][0-9]\s?[A-HJ-PR-Y]{3,3})$|^([A-HJ-NP-Y]{1,3}[0-9]{2,3}?\s[A-Z]{3,3})$|^([A-Z]{1,3}\s?[0-9]{1,4}([A-Z]{1,1})?)$|^([0-9]{4,4}[A-Z]{1,3})$|^([A-Z]{1,2}\s?[0-9]{1,4})$|^([A-Z]{2,3}\s?[0-9]{1,4})$|^([0-9]{1,4}\s?[A-Z]{2,3})$"> I found this regex googling for UK number plate regex, and it seems to work OK for all the number plates (UK) i know.
see my fiddle for a test: https://jsfiddle.net/7yh2wo12/3/