protected String escape(String s){
  StringBuffer result;
  int i;
  result=new StringBuffer();
  for (i=0; i < s.length(); i++) {
    if ((s.charAt(i) == '(') || (s.charAt(i) == ')')) {
      result.append('\\');
    }
    result.append(s.charAt(i));
  }
  return result.toString();
}

protected String escape ( String s ) { StringBuffer result ; int i ; result = new StringBuffer ( ) ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( ( s . charAt ( i ) == '(' ) || ( s . charAt ( i ) == ')' ) ) { result . append ( '\\' ) ; } result . append ( s . charAt ( i ) ) ; } return result . toString ( ) ; }
escapes brackets in the string with backslashes .
