public function regex(string $regex) : Text
    {
        return $this->pipe(
            self::predicate(
                function ($value) use ($regex) {
                    return preg_match($regex, $value) === 1;
                },
                "does not match $regex"
            )
        );
    }