[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 help.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, mrabarnett
priority: normal
severity: normal
status: open
title: sub function would not work without the flags but the search would work 
fine
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com