If I have a set of characters like “abcdefghij” and using this characters, I generate random a password using this characters. A generated password can have, for example, 6 characters. How to validate a password using regex so that tho neighbor characters are not identical and a character does not repeat more that twice?
Share
You could use something like:
Perl quoting, the atomic group can be removed if not supported.
In Java regex it could be written like: