implemented pattern replace charFilter