private static boolean patternHasOnlyWildCardChar(String pattern, char wcc) {
    if (pattern == null) {
      return false;
    }
    boolean ret = true;
    boolean hasWildCard = false;
    for (char pc : pattern.toCharArray()) {
      if (wildCards.contains(pc)) {
        hasWildCard = true;
        ret = ret && (pc == wcc);
        if (!ret) {
          return false;
        }
      }
    }
    return ret && hasWildCard;
  }
The function iterates through the list of wild card characters and sees if
this regular expression contains  only the given char as wild card character.

@param pattern
         pattern expressed as a regular Expression
@param wcc
         wild card character
ql/src/java/org/apache/hadoop/hive/ql/lib/RuleRegExp.java