Here you can find the source of replaceAll(String regex, String ment, String str)
public static String replaceAll(String regex, String ment, String str)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String replaceAll(String regex, String ment, String str) { return replaceAll(regex, ment, str, Pattern.CASE_INSENSITIVE); }/*from ww w. j a v a 2s. com*/ public static String replaceAll(String regex, String ment, String str, int flags) { Pattern pat = null; if (flags == -1) { pat = Pattern.compile(regex); } else { pat = Pattern.compile(regex, flags); } Matcher mat = pat.matcher(str); return mat.replaceAll(ment); } }