code: public static Pattern string(final String string) {
      return new Pattern() {
        @Override public int match(CharSequence src, int begin, int end) {
          if ((end - begin) < string.length()) return MISMATCH;
          return matchString(string, src, begin, end);
        }
        @Override public String toString() {
          return string;
        }
      };
    }
docs: Returns a {@link Pattern} object that matches {@code string} literally.