javascript - How to make regular expression of PAN to progressive regular expression -


i want make progressive regex of pan number.

my pan number regular expression "/^([a-za-z]){5}([0-9]){4}([a-za-z]){1}$/"

format of pan number -'aaaaadddda' a- alphabets, d- digits

why want make progressive regex?

i using angular directive set validations on input field. in facing problem pan regex works fine progressive regex. check here plunker

referred question angularjs validate input , prevent change if invalid

can 1 please suggest me how this?

thank you.

i think should :

regexp = /^([a-za-z]([a-za-z]([a-za-z]([a-za-z]([a-za-z]([0-9]([0-9]([0-9]([0-9]([a-za-z])?)?)?)?)?)?)?)?)?)?$/; 

because progressively want test regex, that's why test input letter letter. ([a-za-z]){5} <- meant needs 5 letters (all @ same time) because testing every letter input that's why did not work.

for example :

aaaaa1111a correct according regex aaaaa1111 or aaaaa111 or aaaaa11 or aaaaa1 etc not, that's why regex did not allow input!

http://plnkr.co/edit/x9x1zt4inghho2f2zl8f?p=preview


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -