Click here to Skip to main content
15,911,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello,
I wrote here the regular expression string to validate the vehicle number
can it will correct.?

"[A-Z]{2}\s[0-9|\s]{1,2}\s[A-Z|\s]{1,2}\s[0-9]{1,4}"

I want to validate Numbers Like..

MH 1 J 1

MH 15 J 9999

MH 15 JH 1234

MH 15 J 1234

Last Four Digit Not greater than four.
Posted
Comments
Sergey Alexandrovich Kryukov 28-Jan-16 1:20am    
"Numbers like", just some samples, is not definition. Define the rule for Indian plate number logically and in a comprehensive way. Than translate it to a Regular Expression.
—SA
Madhuri Gamane 29-Jan-16 0:50am    
^[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}$ Try This

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900