programming-examples/python/Regular_Expression/Replace all occurrences of space, comma, or dot with a colon.py
2019-11-15 12:59:38 +01:00

3 lines
93 B
Python

import re
text = 'Python Exercises, PHP exercises.'
print(re.sub("[ ,.]", ":", text))