sajad torkamani

Syntax:

re.sub(search_pattern, replacement, subject, count=0)

Example:

import re

>>> re.sub("[a-z]", "*", "foobar123")
'******123'

Sources

Tagged: Python

Leave a comment

Your email address will not be published. Required fields are marked *