def regex_match_lines(regex, lines):
    """
    Performs a regex search on each line and returns a list of matched groups
    and a list of lines which didn't match.

    :param regex regex: String to be split and stripped
    :param list lines: A list of strings to perform the regex on.
    """
    matches = []
    bad_lines = []
    for line in lines:
        match = regex.search(line)
        if match:
            matches.append(match.groups())
        else:
            bad_lines.append(line)
    return matches, bad_lines