Want a regex for validating Indian Vehicle Number Format?

前端 未结 11 947
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 21:35

Hello everyone here...

I need to build up a swing application related to vehicle registration and in which i want to do input the vehicle number of indian standard, like

11条回答
  •  梦毁少年i
    2021-01-31 21:57

    Based on the Wikipedia spec:

    ^[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}$
    
    • The first two letters of the registration plate represent the State in which the vehicle is Registered.
    • The next two digit numbers are the sequential number of a district. Due to heavy volume of vehicle registration, the numbers were given to the RTO offices of registration as well.
    • The third part is a 4 digit number unique to each plate. A letter(s) is prefixed when the 4 digit number runs out and then two letters and so on.
    • In some states (such as the union territory of Delhi, and the state of Gujarat) the initial 0 of the district code is omitted; thus Delhi district 2 numbers appear as DL 2 not DL 02.
    • The National Capital Territory of Delhi has an additional code in the registration code: DL 01 C AA 1111

提交回复
热议问题