Regex - string must contain 6-20 characters, with at least 2 digits (don't have to be consecutive) and any number of alphabetic characters


i trying write  regex expression match string between 6 , 20 characters long, has @ least 2 digits not have consecutive, , number of alphabetic characters not have consecutive. non-case sensitive. i've gotten far, it's still not working:

 

^(?=\d*\d{2,}).{6,20}$

 

should match "abc3def1", doesn't because digits aren't consecutive though there 2 of them. match: "abc34def1".

 

please help!

is class project?

 

are limited single expression? if not, while can done, prefer break 2 expressions make easier others , support in future. test 6-20 characters first , pull out numbers , check 2+.



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

after effects warning: unable to create drawing surface

Maximum number of authorizations reached!