Would someone write a regular expression to validate a vehicle number in text box with the below format:
MH-01-XX-0001
This a very simple tasks. Try this:
^[A-Z]{2}-\d{2}-[A-Z]{2}-\d{4}$
[A-Z]
means the capital alphabet characters.\d
means digits.{..}
means how many times the preceding should be repeated.^
means the beginning of the string and the $
means the end of it.