def _egg_info_matches(egg_info, canonical_name):<EOL>
try:<EOL><INDENT>version_start = _find_name_version_sep(egg_info, canonical_name) + <NUM_LIT:1><EOL><DEDENT>except ValueError:<EOL><INDENT>return None<EOL><DEDENT>version = egg_info[version_start:]<EOL>if not version:<EOL><INDENT>return None<EOL><DEDENT>return version<EOL>
Pull the version part out of a string.

    :param egg_info: The string to parse. E.g. foo-2.1
    :param canonical_name: The canonicalized name of the package this
        belongs to.