

def rex_search(self, regexp, flags=0, byte=False, default=NULL):
    '\n        Search the regular expression in response body.\n\n        :param byte: if False then search is performed in\n        `response.unicode_body()` else the rex is searched in `response.body`.\n\n        Note: if you use default non-byte mode than do not forget to build your\n        regular expression with re.U flag.\n\n        Return found match object or None\n\n        '
    regexp = normalize_regexp(regexp, match)
    match = None
    if byte:
        if ((not isinstance(regexp.pattern, six.text_type)) or (not six.PY3)):
            match = regexp.search(self.body)
    elif (isinstance(regexp.pattern, six.text_type) or (not six.PY3)):
        ubody = self.unicode_body()
        match = regexp.search(ubody)
    if match:
        return match
    elif (default is NULL):
        raise DataNotFound(('Could not find regexp: %s' % regexp))
    else:
        return default

dataset/ETHPy150Open lorien/grab/grab/document.py RegexpExtension.rex_search/VarMisuse@32/175 `flags`->`match`