public String replace ( String word ) { int flags = 0 ; if ( ignoreCase ) { flags = flags | Pattern . CASE_INSENSITIVE ; } return Pattern . compile ( pattern , flags ) . matcher ( word ) . replaceAll ( replacement ) ; }
Replace the word with its pattern .