import re

 

my_str = '1=perl,56=python,98=java,12=vbscript'

 

p1 = r'[\d]+'

p2 = r'(?<==)[^,]+'

 

print dict(zip(re.findall(p1,my_str),re.findall(p2,my_str)))

 

'''

>>> {'1': 'perl', '98': 'java', '12': 'vbscript', '56': 'python'}

'''

 

 

'''

>>> re.findall(p1,my_str)

['1', '56', '98', '12']

>>>

'''

'''

>>> re.findall(p2,my_str)

['perl', 'python', 'java', 'vbscript']

>>>

'''