replace multiple patterns by a single one