Here you can find the source of replaceAll(final String regex, final String replaceWith, final String subject)
Parameter | Description |
---|---|
regex | a parameter |
replaceWith | a parameter |
subject | a parameter |
public static String replaceAll(final String regex, final String replaceWith, final String subject)
//package com.java2s; //License from project: Open Source License import java.util.regex.Pattern; import java.util.regex.Matcher; public class Main { /**//from w ww . j a va2s . co m * a method to do a CASE INSENSITIVE regex search-replace * * @param regex * @param replaceWith * @param subject * */ public static String replaceAll(final String regex, final String replaceWith, final String subject) { final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); final Matcher m = p.matcher(subject); return m.replaceAll(replaceWith); } }