def applyFilters(self, headers, table):
result = []<EOL>column_idxs = {}<EOL>for column in list(self._filters.keys()):<EOL><INDENT>try:<EOL><INDENT>column_idxs[column] = headers.index(column)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>' % column)<EOL><DEDENT><DEDENT>for row in table:<EOL><INDENT>for (column, (patterns, <EOL>is_regex, <EOL>ignore_case)) in list(self._filters.items()):<EOL><INDENT>col_idx = column_idxs[column]<EOL>col_val = row[col_idx]<EOL>if is_regex:<EOL><INDENT>for pattern in patterns:<EOL><INDENT>if pattern.search(col_val):<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if ignore_case:<EOL><INDENT>col_val = col_val.lower()<EOL><DEDENT>if col_val in patterns:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>result.append(row)<EOL><DEDENT><DEDENT>return result<EOL>
Apply filter on ps command result.

        @param headers: List of column headers.
        @param table:   Nested list of rows and columns.
        @return:        Nested list of rows and columns filtered using 
                        registered filters.