List of utility methods to do Regex String Replace All
String | replaceAllPerLine(Pattern pattern, String value, String replacement) replace All Per Line final StringBuilder result = new StringBuilder(); try (Scanner scanner = new Scanner(value)) { while (scanner.hasNextLine()) { final String line = scanner.nextLine(); result.append(pattern.matcher(line).replaceAll(replacement)); result.append("\n"); return result.toString(); |
String | replaceAllStrictly(String src, String search, String replacement, boolean entirelyMatch, boolean caseSensitive) ignore regex if (search == null) { if (src == null) { return replacement; } else { return src; } else { if (src == null) { ... |
String | replaceAllTotal(String what, Pattern p, String replacement) replace All Total return p.matcher(what).replaceAll(replacement);
|
String | replaceAllTotal(String what, String expr, String replacement) Version of the String.replaceAll(what, expr, replacement) which ignores new line breaks and case sensitivity
return Pattern.compile(expr, Pattern.CASE_INSENSITIVE | Pattern.DOTALL).matcher(what)
.replaceAll(replacement);
|