def find_matching_rows():
    for word in RegCommon.permutations():
        for idx, row_test in enumerate(row_regex):
            if row_test.match(word):
                try:
                    RegCommon.row_matches[idx].append(word)
                except IndexError:
                    RegCommon.row_matches.append([])
def find_matching_cols():
    for word in RegCommon.permutations():
        for idx, col_test in enumerate(col_regex):
            if col_test.match(word):
                try:
                    RegCommon.col_matches[idx].append(word)
                except IndexError:
                    RegCommon.col_matches.append([])
def col_main():
    global col_regex
    col_regex = RegCommon.compile_regex(cols_tests)
    find_matching_cols()
def row_main():
    global row_regex
    row_regex = RegCommon.compile_regex(rows_tests)
    find_matching_rows()