>>> m = re.search(r'(?<=-)w+', 'spam-egg') >>> m.group(0) 'egg'
re module is used for regex operations. to import, type `import re`. Also, no need to install it since it's built-in in Python.