code: public static String preg_replace(String regex, String replacement, String subject) {
          Pattern p = Pattern.compile(regex);
          return preg_replace(p, replacement, subject);
      }
docs: Matches a string with a regex and replaces the matched components with
  a provided string.
  
  @param regex
  @param replacement
  @param subject
  @return