ID EN
Regular Expression

subn

Python 3.11

Perform the same operation as sub(), but return a tuple (new_string, number_of_subs_made).

Syntax

PYTHON
re.subn(pattern, repl, string, count=0, flags=0)

See Also

sub()