static private StringBuilder replace(StringBuilder input,java.util.regex.Pattern pattern,String replacement){
  java.util.regex.Matcher m=pattern.matcher(input);
  while (m.find()) {
    if (isEscapedChar(input.toString(),m.start())) {
      continue;
    }
    input.replace(m.start(),m.end(),replacement);
    m.reset(input);
  }
  return input;
}

static private StringBuilder replace ( StringBuilder input , java . util . regex . Pattern pattern , String replacement ) { java . util . regex . Matcher m = pattern . matcher ( input ) ; while ( m . find ( ) ) { if ( isEscapedChar ( input . toString ( ) , m . start ( ) ) ) { continue ; } input . replace ( m . start ( ) , m . end ( ) , replacement ) ; m . reset ( input ) ; } return input ; }
replaces strings matching a pattern with another string . if the string to be replaced is escaped with a slash , it is skipped .
