javascript - valid user input which begins with nine digits and ends with x or v -


                       regex = /^[0-9-+]+$/ 

i write above regex valid 9 numbers.but want valid number ends x or v.that means every user input should have x or v @ end of input.i tried following code achieve that.it valid weather input begins 9 digits.

           var flag = regex.test(nic) && nic.length == 10; 

test

regex = /^[0-9]{9}[xv]$/ 

[0-9]{9} checks 9 digits @ start of string
[xv] test end character


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -