Java Utililty Methods Wildcard Match

List of utility methods to do Wildcard Match

Description

The list of methods to do Wildcard Match are organized into topic(s).

Method

booleanwildCardMatch(String text, String pattern)
test the text match the wild char "*"
if (pattern == null || pattern.length() < 1 || "*".equals(pattern)) {
    return true;
if (text == null || text.length() < 1) {
    return false;
String[] cards = pattern.split("\\*");
for (String card : cards) {
...
booleanwildCardMatch(String text, String wildcard)
Performs a WildCard matching for the text and pattern provided.
if (wildcard == null || text == null) {
    return wildcard == null && text == null;
return text.matches(wildcardToRegex(wildcard));
booleanwildcardMatches(String pattern, String text)
Check if pattern string matches text string.
text += '\0';
pattern += '\0';
int N = pattern.length();
boolean[] states = new boolean[N + 1];
boolean[] old = new boolean[N + 1];
old[0] = true;
for (int i = 0; i < text.length(); i++) {
    char c = text.charAt(i);
...