List of usage examples for com.liferay.portal.kernel.util StringParser escapeRegex
public static String escapeRegex(String s)
From source file:com.liferay.wiki.processor.BaseWikiPageRenameContentProcessor.java
License:Open Source License
protected String runRegexps(String content, String title, String newTitle) { for (Map.Entry<String, String> entry : regexps.entrySet()) { String regexp = entry.getKey(); String replacement = entry.getValue(); regexp = regexp.replaceAll("@old_title@", Matcher.quoteReplacement(StringParser.escapeRegex(title))); replacement = replacement.replaceAll("@new_title@", Matcher.quoteReplacement(StringParser.escapeRegex(newTitle))); content = runRegexp(content, regexp, replacement); }//from w w w.j a v a2 s . c o m return content; }