@Override
    public String toString() {
      return String.format(
        "s/%s/%s/%s%s",
        pattern,
        replacement,
        modifier,
        caseInsensitiveUser ? "/L" : "");
    }
I'm the substitution part of an auth-to-local rule.
I have 4 parts:
 s/pattern/replacement/g/L where the last 2 parts are optional.
The pattern part of this expression is a regular expression used to find the portion of the string to replace.
The replacement part of this expression is the value to use for replacing the matched section.
If g is specified after the last /, the replacements will occur for every match in the value, else only the first match is processed.
ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java