[issue41764] sub function would not work without the flags but the search would work fine

2020-09-11 Thread Matthew Barnett
Matthew Barnett added the comment: The arguments are: re.sub(pattern, repl, string, count=0, flags=0). Therefore: re.sub("pattern","replace", txt, re.IGNORECASE | re.DOTALL) is passing re.IGNORECASE | re.DOTALL as the count, not the flags. It's in the documentation and the interactive h

[issue41764] sub function would not work without the flags but the search would work fine

2020-09-11 Thread ali
New submission from ali : it would work like this sub("pattern","replace", txt, flags= re.IGNORECASE | re.DOTALL) but it wouldnt work like this sub("pattern","replace", txt, re.IGNORECASE | re.DOTALL) -- components: Regular Expressions messages: 376734 nosy: bayat, ezio.melotti, mrab