def search_in_table(text_value, table):
    if not isinstance(text_value, str):
        raise TypeError("Expected basestring, got '%s' instead" % type(text_value))
    if not isinstance(table, Table):
        raise TypeError("Expected Document, got '%s' instead" % type(table))

    try:
        tbl_regex = re.compile(text_value)
    except re.error:
        raise ValueError("Invalid regex expression.")

    for r in table.rows:
        for cell in r.cells:
            for paragraph in cell.paragraphs:
                if paragraph.text:
                    if tbl_regex.search(paragraph.text):
                        return cell
    return None
Search for a text into a table and return the cell where found it.
dataset/ETHPy150Open cr0hn/openvas_to_report/openvas_to_report/libs/exporters/word.py/search_in_table