I need help in creating regex based on the following constraints for creating a password. [This is for a course assignment]
Note : I can't use extended regular expression. I need to use core regex,i.e, { | , * , () }
This is my working so far : \
A = { English letters **union** Digits } \
B = { Lowercase letters **union** Digits } \
C = { Uppercase letters **union** Digits } \
D = { Special characters } \
Regex = A(A)* ( B(B)* C(C)* D(D)* )
I can think of a way to solve all the requirements excluding the last one:
A = { English letters **union** Digits }
B = { Lowercase letters }
C = { Uppercase letters }
D = { Digits }
E = { Special characters }
F = { Union of all allowed characters }
Then you need to spell out all the possible permutations:
A (BB* CC* DD* EE* | BB* CC* EE* DD* | BB* DD* CC* EE* | BB* DD* EE* CC* | ...) F*
But if you want to add the "no more than three identical digits" rule, I don't see a way around spelling out all those possibilities as well (and do it 24 times for each permutation), which makes it clear why this is not something you want to do with "core regex"...