List of usage examples for java.util.regex Pattern matches
public static boolean matches(String regex, CharSequence input)
From source file:Main.java
public static boolean verifyPhoneNumber(String phoneNumber) { return Pattern.matches("^1[358][0-9]{9}$", phoneNumber); }
From source file:Main.java
public static boolean checkDigitInt(String digit) { String patrn = "^[+]?\\d+$"; return Pattern.matches(patrn, digit); }
From source file:Main.java
public static boolean checkDigit(String digit) { String regex = "^[-\\+]?\\d+$"; return Pattern.matches(regex, digit); }
From source file:Main.java
public static boolean checkMobile11(String mobile) { String regex2 = "^[0-9]{11}$"; return Pattern.matches(regex2, mobile); }
From source file:Main.java
private static boolean isDouble(String number) { return Pattern.matches("\\d+\\.\\d+", number); }
From source file:Main.java
public static boolean chechHTML(String str) { String regex = "<(S*?)[^>]*>.*?|<.*? />"; return Pattern.matches(regex, str); }
From source file:Main.java
public static boolean verifyName(String name) { String regex = "^[a-zA-Z]+[a-zA-Z0-9_]*$"; return Pattern.matches(regex, name); }
From source file:Main.java
public static boolean isSubDirectory(File sourceLocation, File targetLocation) { return Pattern.matches(sourceLocation.getAbsolutePath() + ".*", targetLocation.getAbsolutePath()); }
From source file:Main.java
public static boolean checkMobile(String mobile) { String regex = "(\\+\\d+)?1[3458]\\d{9}$"; return Pattern.matches(regex, mobile); }
From source file:Main.java
public static boolean isValidKeyWord(String value) { String regex = "^[a-zA-Z0-9-]{6,20}+$"; return Pattern.matches(regex, value); }