def ContentsRegexMatchCondition(self, response, condition_options,
                                  condition_index):
    if not (self.args.no_file_type_check or
            stat.S_ISREG(response.stat_entry.st_mode)):
      return

    options = condition_options.contents_regex_match
    grep_spec = rdf_client.GrepSpec(
        target=response.stat_entry.pathspec,
        regex=options.regex,
        mode=options.mode,
        start_offset=options.start_offset,
        length=options.length,
        bytes_before=options.bytes_before,
        bytes_after=options.bytes_after)

    self.CallClient(
        "Grep", request=grep_spec, next_state="ProcessGrep",
        request_data=dict(
            original_result=response,
            condition_index=condition_index + 1))
Applies contents regex condition to responses.
dataset/ETHPy150Open google/grr/grr/lib/flows/general/file_finder.py/FileFinder.ContentsRegexMatchCondition