replace if-match by match