Example usage for java.util.regex Matcher matches

List of usage examples for java.util.regex Matcher matches

Introduction

In this page you can find the example usage for java.util.regex Matcher matches.

Prototype

public boolean matches() 

Source Link

Document

Attempts to match the entire region against the pattern.

Usage

From source file:Main.java

public static boolean isPhone(String ed1) {
    // TODO Auto-generated method stub
    String regExp = "^(13[0-9]|15[0-9]|17[0-9]|18[0-9]|14[0-9])[0-9]{8}$";
    Pattern p = Pattern.compile(regExp);
    Matcher m = p.matcher(ed1);
    return m.matches();
}

From source file:Main.java

public static boolean isTopMobileNO(String mobiles) {
    Pattern p = Pattern.compile("^((13[0-9])|(15[0-9])|(18[0-9])|(14[0-9])|(17[0-9]))\\d{4}$");
    Matcher m = p.matcher(mobiles);
    return m.matches();
}

From source file:Main.java

/** Validate email address **/
public static boolean validateEmail(String email) {
    Pattern p = Pattern.compile("[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}", Pattern.CASE_INSENSITIVE);
    Matcher m = p.matcher(email);
    return m.matches();
}

From source file:Main.java

public static boolean isValidityEmailAddress(String address) {
    Pattern p = Pattern.compile("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.([a-zA-Z0-9_-])+)+$");
    Matcher m = p.matcher(address);
    return m.matches();
}

From source file:Main.java

public static boolean isGpsLat(String gpsLat) {
    Pattern p = Pattern.compile(GPS_LAT_REGULAR);
    Matcher m = p.matcher(gpsLat);
    return m.matches();
}

From source file:Main.java

public static boolean is15IDcard(String idString) {
    Pattern p = Pattern.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
    Matcher m = p.matcher(idString);
    return m.matches();
}

From source file:Main.java

public static boolean isTelPhoto(String mobiles) {
    Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$");
    Matcher m = p.matcher(mobiles);
    return m.matches();
}

From source file:Main.java

public static boolean isMobileNO(String mobiles) {
    Pattern p = Pattern.compile("^1(3[0-9]|4[57]|5[0-35-9]|8[025-9])\\d{8}$");
    Matcher m = p.matcher(mobiles);
    return m.matches();
}

From source file:Main.java

public static boolean isMobileNO(String mobiles) {
    Pattern p = Pattern.compile("^((13[0-9])|(15[0-9])|(18[0-9])|(14[0-9])|(17[0-9]))\\d{8}$");
    Matcher m = p.matcher(mobiles);
    return m.matches();
}

From source file:Main.java

public static boolean isMobileNo(String mobile) {
    Pattern p = Pattern.compile(MOBILE_REGULAR);
    Matcher m = p.matcher(mobile);
    return m.matches();
}