Here you can find the source of replaceAll(String string, Pattern[] patterns, String replacement)
public static String replaceAll(String string, Pattern[] patterns, String replacement)
//package com.java2s; //License from project: Apache License import java.util.regex.Pattern; public class Main { public static String replaceAll(String string, Pattern[] patterns, String replacement) { if (string == null || string.length() == 0) { return string; }/*from w ww . jav a 2 s. c o m*/ if (patterns != null) { for (Pattern pattern : patterns) { string = pattern.matcher(string).replaceAll(replacement); } } return string; } }