Solving issues with regex macros