def rex_text(
        self,
        regexp: str | bytes | Pattern[str] | Pattern[bytes],
        flags: int = 0,
        default: Any = UNDEFINED,
    ) -> Any:
        """Return content of first matching group of regexp found in response body."""
        try:
            match = self.rex_search(regexp, flags=flags)
        except DataNotFound as ex:
            if default is UNDEFINED:
                raise DataNotFound("Regexp not found") from ex
            return default
        return match.group(1)
Return content of first matching group of regexp found in response body.
grab/document.py