Want a regex for validating Indian Vehicle Number Format?

前端 未结 11 967
隐瞒了意图╮
隐瞒了意图╮ 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 22:12

    just check it out for whitespace only...

      function isValidNumber($Number){
             $pattern = "^[a-zA-z]{2}\s[0-9]{2}\s[0-9]{4}$";
             if (eregi($pattern, $Number)){
                return true;
             }
             else {
                return false;
            }
        }
    

提交回复
热议问题