Code example for Matcher

Methods: replaceAll

0
	 * @param matchFlags 
	 */ 
	@Override 
	public void setPattern(String regularExpr, int matchFlags) {
		Matcher match = BAD_STUFF.matcher(regularExpr);
      String searchString = match.replaceAll("\\\\$1");
 
		log.debug("PATTERN IS: \"" + searchString +"\"");
 
		if ((searchString == null) || (searchString.length() == 0)) {
			searchString = ".*";
		} 
		setPattern(Pattern.compile(searchString, matchFlags | Pattern.CASE_INSENSITIVE));
	} 
}