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
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