code: public static Pattern regex(final java.util.regex.Pattern p) {
      return new Pattern() {
        @Override
        public int match(CharSequence src, int begin, int end) {
          if (begin > end)
            return MISMATCH;
          Matcher matcher = p.matcher(src.subSequence(begin, end));
          if (matcher.lookingAt())
            return matcher.end();
          return MISMATCH;
        }
      };
    }
docs: Adapts a regular expression pattern to a {@link Pattern}.
  
  <p><em>WARNING</em>: in addition to regular expression cost, the returned {@code Pattern} object needs
  to make a substring copy every time it's evaluated. This can incur excessive copying and memory overhead
  when parsing large strings. Consider implementing {@code Pattern} manually for large input.