core/metrics-core-service/src/main/java/org/hawkular/metrics/core/service/PatternUtil.java
public static Pattern filterPattern(String inputRegexp) {
        if (inputRegexp.equals("*")) {
            inputRegexp = ".*";
        } else if (inputRegexp.startsWith("!")) {
            inputRegexp = inputRegexp.substring(1);
        }
        return Pattern.compile(inputRegexp); // Catch incorrect patterns..
    }
public static Pattern filterPattern(String inputRegexp) {
        if (inputRegexp.equals("*")) {
            inputRegexp = ".*";
        } else if (inputRegexp.startsWith("!")) {
            inputRegexp = inputRegexp.substring(1);
        }
        return Pattern.compile(inputRegexp); // Catch incorrect patterns..
    }
Allow special cases to Pattern matching, such as "*" -> ".*" and ! indicating the match shouldn't
happen. The first ! indicates the rest of the pattern should not match.

@param inputRegexp Regexp given by the user
@return Pattern modified to allow special cases in the query language