python match and replace part of string code example
Example: python replace matching string
s = 'one two one two one'
# 1st argument: string to find
# 2nd argument: string to put in place
print(s.replace(' ', '-')) # one-two-one-two-one
s = 'one two one two one'
# 1st argument: string to find
# 2nd argument: string to put in place
print(s.replace(' ', '-')) # one-two-one-two-one