Reputation: 137
I have the following regex to match this:
U$MichaelU$P@$asdqwe123P@$
- this is correct; the other two are not
U$NameU$P@$PasswordP@$
U$UserU$P@$ad2P@$
A registration is valid when:
My regex is
@"^(U\S)([A-z][a-z]{3,})\1(P@\S)([a-z]{5,}[^\d])([\d]+)\3$"
The problem is that it matches the first one but when I submit to the judge it passes first 2 test but the rest it breaks, could you please tell me where is my mistake.
Upvotes: 0
Views: 197
Reputation: 106
Hello your regex must be
@"^(U\S)([A-Za-z]{3,})\1(P@\S)([A-Za-z0-9]{5,})\3$"
it works for you
Upvotes: 2