blob: a0af2c24d7055a17e91143482328452dce52b7c2 [file] [log] [blame]
package org.eclipse.mdm.api.atfxadapter.util;
public class PatternUtil {
/**
*
* @param pattern
* @return true if the pattern contains an unescaped wildcard character
*/
public static boolean containsUnescapedWildcard(String pattern) {
boolean foundBackslash = false;
for (char c : pattern.toCharArray()) {
if ((c == '?' || c == '*') && !foundBackslash) {
return true;
}
if (c == '\\') {
foundBackslash = !foundBackslash;
} else {
foundBackslash = false;
}
}
return false;
}
}