benel / Dolomite

Directories Led by Members
https://github.com/benel/Dolomite/wiki
21 stars 20 forks source link

FIX : Password check #28

Closed paulleboullenger closed 13 years ago

paulleboullenger commented 13 years ago

Inscription.java modified, in order to pass the "Registration_Test__KO_password_not_correct" test

kamwaStephanie commented 13 years ago

I think there is a mistake in the regex u changed on the method checkPass in the Inscription.java class.

if (password1.matches("[a-zA-Z]"): this return true if the string password1 matches exactely [a-zA-Z]. That means that password1 only have one character in this range of values. So ab, ac, abc3 won't work.

It is the same with your regex password1.matches("[0-9]")): this return true if the string password1 matches exactely [0-9]. That means that password1 only have one character in this range of values. So 10, 11, 13E won't work.

But if you want to specify contains instead of "exactely" , you could try this regex if( (password2.matches(".[a-zA-Z].[0-9].")) || (password2.matches(".[0-9].[a-zA-Z].")))