Example usage for java.lang String matches

List of usage examples for java.lang String matches

Introduction

In this page you can find the example usage for java.lang String matches.

Prototype

public boolean matches(String regex) 

Source Link

Document

Tells whether or not this string matches the given regular expression.

Usage

From source file:Main.java

private static boolean isNumeric(String str) {
    if (str.matches("\\d*")) {
        return true;
    } else {/*from  w  w  w  .  ja  v  a  2  s  . c om*/
        return false;
    }
}

From source file:Main.java

public static boolean isBigCapital(String capital) {
    return capital.matches("[\\u0041-\\u005A]+");
}

From source file:Main.java

public static boolean isMobileNO(String mobiles) {
    return mobiles.matches("^((13[0-9])|(14[0-9])|(15[0-9])|(18[0-9]))\\d{8}$");
}

From source file:Main.java

public static boolean isPasswordValid(String password) {
    return password.matches("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{8,15})");
}

From source file:Main.java

public static boolean isLicenseValid(String license) {
    return license.matches(LICENSE_PATTERN);
}

From source file:Main.java

public static boolean isName(String valueStr) {
    return valueStr.matches("CN=.*\\/O=.*");
}

From source file:Main.java

public static boolean isValidCellphoneNumber(String cellphone) {
    return cellphone.matches("^(1[34578][0-9])\\d{8}$");
}

From source file:Main.java

public static boolean ValidatePassword(String password) {
    return (password.matches("^[\\w!@#\\$%\\^&\\*\\(\\)]{4,12}$"));
}

From source file:Main.java

public static boolean ValidPhoneNumber(String pn) {
    return pn.matches("\\d{8,}");
}

From source file:Main.java

public static boolean isPasswordValid(String password) {
    return password.matches(PASSWORD_PATTERN);
}