code: private Pattern getPattern(String expr)
      {
          Pattern pattern = patterns.get(expr);
          if(pattern == null)
          {
              pattern = Pattern.compile(expr);
              patterns.put(expr, pattern);
          }
          return pattern;
      }
docs: Returns the pattern for the given regular expression.
  @param expr A regex to use for formatting
  @return The pattern for the expression