Python: Perform a regex replace
30 October 2022 (Updated 30 October 2022)
Syntax:
re.sub(pattern, repl, string, count=0)
Example:
import re
>>> re.sub("[a-z]", "*", "foobar123")
'******123'
Sources
Tagged:
Python