I have a text txt = 'The fat \m{cat sat} on \m{the} mat.'
which I hope to output 'The fat cat sat on the mat.'
I have tried the following two ways:
re.sub(r'\\m\{(.*)\}', '', txt)
# output: 'The fat mat.'
re.sub(r'\\m\{(?=.*)\}', '', txt)
# output: 'The fat \\m{cat sat} on \\m{the} mat.'
Why is that and how should I do?