Had forgotten to import re module.