<reponame>vhn0912/python-snippets<gh_stars>100-1000
s = 'abc-xyz-123-789-ABC-XYZ'

print(s.replace('xyz', ''))
# abc--123-789-ABC-XYZ

import re

s = 'abc-xyz-123-789-ABC-XYZ'

print(re.sub('\d+', '', s))
# abc-xyz---ABC-XYZ

s = 'abc-xyz-123-789-ABC-XYZ'

print(s.replace('xyz', ''))
# abc--123-789-ABC-XYZ

import re

s = 'abc-xyz-123-789-ABC-XYZ'

print(re.sub('\d+', '', s))
# abc-xyz---ABC-XYZ
# abc--123-789-ABC-XYZ # abc-xyz---ABC-XYZ