def _regex_validator(regex):
    """Validates the provided regular expression."""
    try:
        re.compile(regex)
    except Exception, e:
        raise ValidationError('This regex is invalid: %s' % e)
dataset/ETHPy150Open reviewboard/ReviewBot/extension/reviewbotext/forms.py/_regex_validator/original