Filtering lines in a log file using multiple regexes
I wouldn’t worry about performance of the loop here. The slow thing isn’t the loop, it’s the matching of the expressions.

That said, I’d express the nested loops via list comprehension instead.

def filter_lines(instream, filters):
    return ((line, regex) for regex in filters for line in instream if regex.match(line))


Or alternatively, using higher-order list functions:

def filter_lines(instream, filters):
    return filter(lambda (line, rx): rx.match(line), itertools.product(instream, filters))