In python,
with re.sub
, how I can replace a substring with a new string ?
from
number = "20"
s = "hello number 10, Agosto 19"
to
s = "hello number 20, Agosto 19"
I try
re.sub(r'number ([0-9]*)', number, s)
EDIT
the number 10
is a example, the number in the string can be any number.