def __call__(self, inst, attr, value):
        """
        We use a callable class to be able to change the ``__repr__``.
        """
        if not self.match_func(value):
            raise ValueError(
                "'{name}' must match regex {pattern!r}"
                " ({value!r} doesn't)".format(
                    name=attr.name, pattern=self.pattern.pattern, value=value
                ),
                attr,
                self.pattern,
                value,
            )

        We use a callable class to be able to change the ``__repr__``.
        
product/gradle-plugin/src/main/python/attr/validators.py