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 isBlank(String str) {
    if (str == null || str.matches("[ ]{0,}")) {
        return true;
    }/*from w  w  w.j av a 2  s  .c  om*/
    return false;
}

From source file:Main.java

public static boolean midIsSpace(String str) {
    boolean mat = str.matches("^(\\s|.*\\s+.*)$");
    if (mat) {/*from w  w  w  . jav a 2 s  . c o  m*/
        return true;
    } else {
        return false;
    }
}

From source file:Main.java

public static boolean isValidToken(String token) {
    return token != null && token.matches("^[a-f0-9]{64}$");
}

From source file:Main.java

public static boolean isIPAddr(String input) {
    return (input != null && input.matches("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"));
}

From source file:Main.java

public static boolean isXMLNCName(String string) {
    return string != null && string.matches("[a-zA-Z_][a-zA-Z0-9_.-]*");
}

From source file:Main.java

public static boolean isXMLName(String string) {
    return string != null && string.matches("[a-zA-Z_:][a-zA-Z0-9_:.-]*");
}

From source file:Main.java

public static boolean validateLogin(String login) {
    return login != null && login.matches(LOGIN_PATTERN);
}

From source file:Main.java

/**
 * /*w ww.  j  a v a  2s .c  o m*/
 * @param name
 * @return
 */
public static boolean isTemporaryResultSetComputedColumn(String name) {
    return name.matches(RESULT_SET_COMPUTED_COLUMN_NAME_PATTERN);
}

From source file:Main.java

public static boolean testEmpty(String str) {
    if ((str == null) || str.matches("^\\s*$")) {
        return true;
    } else {/*from  w ww. j a  v  a2s . c o m*/
        return false;
    }
}

From source file:Main.java

public static boolean isWhiteSpace(String str) {
    if ((str == null) || str.matches("^\\s*$") || str.equals("")) {
        return true;
    } else {// w  w w  .  java  2s .co  m
        return false;
    }
}