Since the examples show a space between the two words (the product ID and the version information), I would expect to design a regex which uses that space to separate the parts. In Perl:
$line =~ s/^(A\S+)\s+ver\.\s?\d{1,2}/$1/;
This removes (without capturing) the version; if the version is not present, then the substitution does nothing.
$line =~ s/^(A\S+)(?:\s+(ver\.\s?\d{1,2}))?/$1/;
This is an almost trivial variation on the idea; it captures the version string if present (as well as substituting, etc. Note the subtlety that the space before the version string is included in the optional material but not captured '(?:...)?
', but the version information is captured without leading spaces.
Quoting the regexes in the abstract, without tying them to the Perl context (though they're still using PCRE - Perl Compatible Regular Expression - notation), you could write:
^(A\S+)(?:\s+(ver\.\s?\d{1,2}))?