PageRenderTime 98ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/app/src/main/java/uk/co/radicas/android/util/ValidationUtils.java

https://bitbucket.org/Zeee/testapp
Java | 26 lines | 20 code | 6 blank | 0 comment | 2 complexity | a8116358c6b470a7479e25698b6dbc0e MD5 | raw file
  1. package uk.co.radicas.android.util;
  2. import java.util.regex.Pattern;
  3. public class ValidationUtils {
  4. private static final Pattern EMAIL_ADDRESS_REGEX
  5. = Pattern.compile(
  6. "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
  7. "\\@" +
  8. "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
  9. "(" +
  10. "\\." +
  11. "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
  12. ")+"
  13. );
  14. public static boolean isEmailValid(String email){
  15. return EMAIL_ADDRESS_REGEX.matcher(email).matches();
  16. }
  17. public static boolean isPasswordValid(String password){
  18. return password != null && password.length() >= 8;
  19. }
  20. }