Kokoglen
asked on
Regular Expression - Repeating characters
I am validating client-side passwords per a customers requirements. I have all except one.
Need a regular expression where it will return a result of false if the string has 3 repeating characters in a row anywhere in the string.
Must be regular expression, but I am interested in any solutions...pulling hair out currently.
Thanks!
Need a regular expression where it will return a result of false if the string has 3 repeating characters in a row anywhere in the string.
Must be regular expression, but I am interested in any solutions...pulling hair out currently.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
/.{3,}/ will return detect strings of length 3 or more not repeating chars
My mistake ... that will match any string of 3 or more characters. Forget my answer =)
ASKER
Works good. Thank you. I actually shouldve asked the question in the Java or JSP question as I need to apply it to struts, but this will get me started. Thank you again.
The regular expression you're looking for is:
/.{3,}/
Do you need help implementing a regular expression in JS?