It's more specific to catch `re.error` here, although it's likely to be the only exception to occur anyway.