in reply to regex in password changing
No need to use a regex.
If the difference in length between both passwords is 3 or more, you already have your 3 character difference.
Otherwise check the first character of the shorter string against the first character of the longer string, do the same with the second, third, ... characters, adding one to the difference in length between two passwords: as soon as your sum is three, the new password is OK.
If you run out of characters and still the sum is less than three, the new password is wrong.
However, if you simply add one new character to the beginning of the old password to make a new password, this algoritm will say this is OK and that is perhaps not what you are looking for.
If that is indeed the case, do the following:
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|