public void addRule(String name, String ruleRegex) {
        for (PatternRule rule : rules) {
            if (rule.name.equals(name)) {
                return;
            }
        }
        PatternRule rule = new PatternRule(name, ruleRegex);
        rules.add(rule);
    }
Add a new match rule. The rule will follow the order of being added.

@param name      will be used when ruleRegex matched.
@param ruleRegex to match target string.
oap-server/server-library/library-util/src/main/java/org/apache/skywalking/oap/server/library/util/StringFormatGroup.java