Replace expanded match with macro.