import re


def longest_matching(lines, regex):
    """Returns the index of the first : in the longest matching line

    :param lines: list of strings to find the longest parameter in
    :param regex: regex to identify the lines to compare

    :returns: The highest index of the first : in the matching lines,
              or None if no line matches the given regex
    """
    longest = None
    for line in lines:
        if re.match(regex, line):
            index = line.index(":")
            if index > longest:
                longest = index

    return longest