static boolean isRegex(String pattern, HiveConf conf) {
    String qIdSupport = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_QUOTEDID_SUPPORT);
    if (!"none".equals(qIdSupport)) {
      return false;
    }
    for (int i = 0; i < pattern.length(); i++) {
      if (!Character.isLetterOrDigit(pattern.charAt(i))
          && pattern.charAt(i) != '_') {
        return true;
      }
    }
    return false;
  }
Returns whether the pattern is a regex expression (instead of a normal
string). Normal string is a string with all alphabets/digits and "_".
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java