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; | |
} | |
} |