'recvregex(regex, exact = False, keepends = False, timeout = default) -> str
Wrapper around :func:`recvline_pred`, which will return when a regex
matches a line.
By default :func:`re.RegexObject.search` is used, but if `exact` is
set to True, then :func:`re.RegexObject.match` will be used instead.
If the request is not satisfied before ``timeout`` seconds pass,
all data is buffered and an empty string (``\'\'``) is returned.'

def recvline_regex(self, regex, exact=False, keepends=False, timeout=default):

    if isinstance(regex, (str, unicode)):
        regex = re.compile(regex)
    if exact:
        pred = regex.match
    else:
        pred = regex.search
    return self.recvline_pred(pred, keepends=keepends, timeout=timeout)
