javascript - regular expression to avoid repeat for 4 times -


i tried regular expression avoid repeat of digits more 4 continuous times 11111 , working fine:

([0-9])\1{4}

but need avoid repeat of digits more 6 times 11111121 don't know how it.

thanks

you can use following lookahead assertion:

^(?!.*(\d)(?:.*\1){6})(?!.*(\d)\2{4})\d+ 

see demo


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -