public void replace(DocumentFilter.FilterBypass fb,int offset,int length,String text,AttributeSet attrs) throws BadLocationException {
  if (text == null)   text="";
  text=replaceMetaCharacters(text);
  fb.replace(offset,length,text,attrs);
  parseDocument(offset,text.length());
}

public void replace ( DocumentFilter . FilterBypass fb , int offset , int length , String text , AttributeSet attrs ) throws BadLocationException { if ( text == null ) text = "" ; text = replaceMetaCharacters ( text ) ; fb . replace ( offset , length , text , attrs ) ; parseDocument ( offset , text . length ( ) ) ; }
replace a string in the document , and then parse it if the parser has been set .
