List of usage examples for java.lang String matches
public boolean matches(String regex)
From source file:Main.java
public static boolean isInteger(String str) { return (str.matches("^-?\\d+$")); }
From source file:Main.java
public static boolean isNameValid(String name) { return name.matches(NamePattern); }
From source file:Main.java
public static boolean ValidateEmail(String email) { return (email.matches("^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$")); }
From source file:Main.java
public static boolean isNumeric(String str) { return str.matches("[0-9]*"); }
From source file:Main.java
public static boolean isEmailValid(String email) { return email.matches(EmailPattern); }
From source file:Main.java
public static boolean checkEmail(String email) { return email.matches( "^[_A-Za-z0-9-]+(\\." + "[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*" + "(\\.[A-Za-z]{2,})$"); }
From source file:Main.java
public static boolean isValidEmailAddress(String email) { return email.matches(EMAIL_REGEXP); }
From source file:Main.java
public static boolean isPhoneNumberValid(String phone) { return phone.matches(PHONE_PATTERN); }
From source file:Main.java
public static boolean validatePassword(String password) { return password.matches("(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}"); }
From source file:Main.java
public static boolean isEmail(String email) { return email.matches("^(\\w)+(\\.\\w+)*@(\\w)+((\\.\\w+)+)$"); }