def split_name_and_version(some_string):
    "Splits a string into the name and version number.\n\n    Name and version must be separated with a hyphen ('-')\n    or double hyphen ('--').\n    'TextWrangler-2.3b1' becomes ('TextWrangler', '2.3b1')\n    'AdobePhotoshopCS3--11.2.1' becomes ('AdobePhotoshopCS3', '11.2.1')\n    'MicrosoftOffice2008-12.2.1' becomes ('MicrosoftOffice2008', '12.2.1')\n    "
    for delim in ('--', '-'):
        if (some_string.count(delim) > 0):
            chunks = some_string.split(delim)
            vers = chunks.pop()
            name = delim.join(chunks)
            if (vers[0] in '0123456789'):
                return (name, vers)
    return (some_string, '')
Splits a string into the name and version number.

Name and version must be separated with a hyphen ('-')
or double hyphen ('--').
'TextWrangler-2.3b1' becomes ('TextWrangler', '2.3b1')
'AdobePhotoshopCS3--11.2.1' becomes ('AdobePhotoshopCS3', '11.2.1')
'MicrosoftOffice2008-12.2.1' becomes ('MicrosoftOffice2008', '12.2.1')
def split_name_and_version(some_string):
    "Splits a string into the name and version number.\n\n    Name and version must be separated with a hyphen ('-')\n    or double hyphen ('--').\n    'TextWrangler-2.3b1' becomes ('TextWrangler', '2.3b1')\n    'AdobePhotoshopCS3--11.2.1' becomes ('AdobePhotoshopCS3', '11.2.1')\n    'MicrosoftOffice2008-12.2.1' becomes ('MicrosoftOffice2008', '12.2.1')\n    "
    for delim in ('--', '-'):
        if (some_string.count(delim) > 0):
            chunks = some_string.split(delim)
            vers = chunks.pop()
            name = delim.join(chunks)
            if (vers[0] in '0123456789'):
                return (name, vers)
    return (some_string, )