List of utility methods to do Wildcard
String | wildcardToCaseInsensitiveRegex(final String pattern) wildcard To Case Insensitive Regex if (pattern == null) { return null; return "(?i)".concat(wildcardToRegex(pattern)); |
String | wildcardUserToSql(String exp) Turn a user supplied wildcard expression with * into an SQL LIKE/NOT LIKE expression with %'s and other special characters. StringBuffer sb = new StringBuffer(); for (int i = 0; i < exp.length(); i++) { String substring = exp.substring(i); if (substring.startsWith("*")) { sb.append("%"); } else if (substring.startsWith("?")) { sb.append("_"); } else if (substring.startsWith("\\*")) { ... |