[issue42473] re.sub ignores flag re.M

2020-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: Not a bug. Argument 4 of re.sub is the count: sub(pattern, repl, string, count=0, flags=0) not the flags. -- nosy: +mrabarnett resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue42473] re.sub ignores flag re.M

2020-11-26 Thread Jérôme Laurens
New submission from Jérôme Laurens : Test code: ``` import re test='''012345678 012345678 ''' pattern = r'^\s+?$' m = re.search(pattern, test, re.M) if m: print(f'TEST FOUND "{m.span()}"') def replace(m): print(f'TEST REMOVE {m.span()}') return '' test =