What I want to do is just check when the user is signing up that whether the password entered is at least 6 characters and has no space in it. Thats pretty much it. What would be a regex that I could use in Java Pattern Matcher classes for this purpose?
Thanks for your help guys.
Why do you want to use a regex?
public boolean isPasswordValid( String password )
{
return ((password.length() >= 6) && (!password.contains(" "));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With