<s>[INST] def find_matching_substring(s, pattern):
    """
    Find the longest common substring of s and pattern.

    Args:
        s (str): The main string.
        p (str): The pattern to search for.

    Returns:
        str: The longest matching substring.

    """[/INST]