def _match_field(line, field):
    """
    Return the remaining part of the line in case of matching field,
    otherwise it returns None.
    """

    if line is None or len(line) < 2:
        return None

    if line[0] == '*' and line[1] == ':':
        # Match (star).
        return line[2:]

    escaped = False
    while line:
        if not escaped and line[0] == '\\':
            line = line[1:]
            escaped = True

        if not line:
            return None

        if not escaped and line[0] == ':' and not field:
            # match
            return line[1:]

        escaped = False
        if not field:
            return None
        elif field[0] == line[0]:
            line = line[1:]
            field = field[1:]
        else:
            return None
    return None