def longest_match(list1, list2):
    """
    Find the length of the longest substring match between list1 and list2.

    >>> longest_match([], [])
    0
    >>> longest_match('test', 'test')
    4
    >>> longest_match('test', 'toast')
    2
    >>> longest_match('supercalifragilisticexpialidocious', 'mystical californication')
    5
    """
    m = len(list1)
    n = len(list2)
    data = [[(0) for col in range(n + 1)] for row in range(m + 1)]
    for a in range(1, m + 1):
        for b in range(1, n + 1):
            if list1[a - 1] == list2[b - 1]:
                data[a][b] = 1 + data[a - 1][b - 1]
            else:
                data[a][b] = 0
    maxes = [max(row) for row in data]
    return max(maxes)
