code: public static String escape(final String input) {
  		String output;
  
  		output = input.replaceAll("\\\\", Matcher.quoteReplacement("\\\\"));
  		output = output.replaceAll("\\{", Matcher.quoteReplacement("\\{"));
  		output = output.replaceAll("\\}", Matcher.quoteReplacement("\\}"));
  		output = output.replaceAll("\\(", Matcher.quoteReplacement("\\("));
  		output = output.replaceAll("\\)", Matcher.quoteReplacement("\\)"));
  		output = output.replaceAll("\\[", Matcher.quoteReplacement("\\["));
  		output = output.replaceAll("\\]", Matcher.quoteReplacement("\\]"));
  		output = output.replaceAll("\\*", Matcher.quoteReplacement("\\*"));
  		output = output.replaceAll("\\+", Matcher.quoteReplacement("\\+"));
  		output = output.replaceAll("\\$", Matcher.quoteReplacement("\\$"));
  		output = output.replaceAll("\\^", Matcher.quoteReplacement("\\^"));
  		output = output.replaceAll("\\?", Matcher.quoteReplacement("\\?"));
  		output = output.replaceAll("\\.", Matcher.quoteReplacement("\\."));
  		output = output.replaceAll("\\|", Matcher.quoteReplacement("\\|"));
  
  		return output;
  	}
docs: To be able to use generated data within a regular expression we need to escape characters
  that are otherwise interpreted as special characters. Currently the following characters are
  escaped:
  <ul>
  <li><code>\</code></li>
  <li><code>{</code></li>
  <li><code>}</code></li>
  <li><code>(</code></li>
  <li><code>)</code></li>
  <li><code>[</code></li>
  <li><code>]</code></li>
  <li><code>*</code></li>
  <li><code>+</code></li>
  <li><code>$</code></li>
  <li><code>^</code></li>
  <li><code>?</code></li>
  <li><code>.</code></li>
  </ul>
  
  @param input
  the string which we want to use in a regular expression
  @return the input string with all special characters escaped