sdlangers Posted December 17, 2005 Posted December 17, 2005 hi, i have a 10 digit random number generated i want to check that there are the same digit is not in the number 3 times in a row e.g. 1224526890 is ok, but 1222426890 is not ok because 2 is there 3 times in a row i guess some type of regular expression can do this, but i dont know how to use these or which one to use thanks for your help Quote
HJB417 Posted December 19, 2005 Posted December 19, 2005 0{3}|1{3}|2{3}|3{3}|4{3}|5{3}|6{3}|7{3}|8{3}|9{3} Quote
sdlangers Posted December 19, 2005 Author Posted December 19, 2005 0{3}|1{3}|2{3}|3{3}|4{3}|5{3}|6{3}|7{3}|8{3}|9{3} perfect - thanks. Quote
IngisKahn Posted December 19, 2005 Posted December 19, 2005 A bit more compact: (\d)(?:\1){2} Quote "Who is John Galt?"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.