List of usage examples for java.util.regex Pattern compile
public static Pattern compile(String regex)
From source file:Main.java
public static boolean validateIp(String str) { Pattern pattern = Pattern.compile("[0-9],."); Matcher matcher = pattern.matcher(str); return matcher.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 isPwd(String str) { Pattern pattern = Pattern.compile("[A-Za-z0-9_]+"); Matcher isPwd = pattern.matcher(str); if (!isPwd.matches()) { return false; }//from w w w . j a v a2 s . co m return true; }
From source file:Main.java
public static boolean isPhoneNumber(String mobiles) { Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$"); Matcher m = p.matcher(mobiles); return m.matches(); }
From source file:Main.java
public static boolean isPassWordIllegal(String pwd) { Pattern p = Pattern.compile("/(?!^\\d+$)(?!^[a-zA-Z]+$)[0-9a-zA-Z]{6,12}/"); Matcher m = p.matcher(pwd);//from w w w. ja v a 2 s.com return m.matches(); }
From source file:Main.java
public static boolean regexName(String str) { Pattern pattern = Pattern.compile("[\u4e00-\u9fa5a-zA-Z]{2,24}"); Matcher isNum = pattern.matcher(str); return isNum.matches(); }
From source file:Main.java
public static boolean isNumeric(String str) { Pattern pattern = Pattern.compile("[0-9]*"); Matcher isNum = pattern.matcher(str); return isNum.matches(); }
From source file:Main.java
License:asdf
static boolean startsWithDigitOrUpper(String s) { return Pattern.compile("^[A-Z0-9]").matcher(s).find(); }
From source file:Main.java
public static boolean isBankCard(String cardNo) { Pattern p = Pattern.compile("^\\d{16,19}$|^\\d{6}[- ]\\d{10,13}$|^\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4,7}$"); Matcher m = p.matcher(cardNo); 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(); }