delete matched text when pattern found