import re
from operator import itemgetter
mystr = 'Version 1.15.6\n'
m = re.match('Version (?P<_0>.+)\\.(?P<_1>.+)\\.(?P<_2>.+)', mystr)
map(itemgetter(1), sorted(m.groupdict().items()))
Convert string to variables (like format(), but in reverse) in Python