re module grants all regular expression functions to Python code example
Example 1: re.sub in python example
import re
result = re.sub(pattern, repl, string, count=0, flags=0);
Example 2: re module documentation
>>> m = re.search(r'(?<=-)\w+', 'spam-egg')
>>> m.group(0)
'egg'