List of usage examples for java.util.regex Matcher matches
public boolean matches()
From source file:Main.java
public static boolean isMobileNO(String mobiles) { Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"); Matcher m = p.matcher(mobiles); return m.matches(); }
From source file:Main.java
public static boolean isGpsLng(String gpsLng) { Pattern p = Pattern.compile(GPS_LNG_REGULAR); Matcher m = p.matcher(gpsLng); return m.matches(); }
From source file:Main.java
public static boolean isValidUserName(String userName) { Pattern p = Pattern.compile("^[\u4E00-\u9FA50-9a-zA-Z_-]{0,}$"); Matcher m = p.matcher(userName); return m.matches(); }
From source file:Main.java
public static boolean isCorrectEmail(String email) { String str = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; Pattern p = Pattern.compile(str); Matcher m = p.matcher(email); return m.matches(); }
From source file:Main.java
public static boolean ChekIsEmpty(String content) { Pattern p = Pattern.compile("^[^\\s]+$"); Matcher m = p.matcher(content); return m.matches(); }
From source file:Main.java
public static boolean isAlphaNumeric(String str) { String strPattern = "[0-9a-zA-Z]+$"; // String strPattern = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{2,}$";? Pattern p = Pattern.compile(strPattern); Matcher m = p.matcher(str); return m.matches(); }
From source file:Main.java
public static boolean isAMail(String mail) { if (mail == null) return false; Pattern p = Pattern.compile("^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@"); Matcher m = p.matcher(mail); return m.matches(); }
From source file:Main.java
public static boolean isPassword(String mobiles) { Pattern p = Pattern.compile("^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$"); Matcher m = p.matcher(mobiles); return m.matches(); }
From source file:Main.java
public static boolean passwordRegExp_8(String password) { Pattern p = Pattern.compile("^(?![A-Z]*$)(?![a-z]*$)(?![0-9]*$)(?![^a-zA-Z0-9]*$)\\S{8,}"); Matcher m = p.matcher(password); return m.matches(); }
From source file:Main.java
public static boolean matchRex(String src, String rex) { Pattern p = Pattern.compile(rex); Matcher m = p.matcher(src); return m.matches(); }