def line_containing_regex(text, regex):
    """Return the line in text for which regex.search(line) is truthy.  One must match."""
    return [line for line in text.split('\n') if regex.search(line)][0]