import re
import pprint
pp = pprint.PrettyPrinter(indent=4)
regex = r"^[^\S\r\n]*(\S+)[^\d\r\n]+(\d+(?:\.\d+)?)[^\d\r\n]*(\d+(?:\.\d+)?)?"
dict = {}
test_str = (" hUbo2 21.8. ssol/t vsdw \n"
" AE(k) =3.0 asdsddf/as\n"
" Cat+ 1.1 fasdl/ aoKw \n"
"Glu 38\n"
"Dac < 0.30\n"
" DH 7.350 - 7.450\n"
" iKo2 35.0 —- 48.0\n"
" LE(dcf) 2.0- 3.0\n"
" Lp+ 138 ~ 146\n"
" C1- 98 - 107 hjkkl/asL \n"
" LKu 74 ~ 100 \n"
" Arsa 9.51 - 1.19 \n"
" s$92 94.0 - 98.0 % ")
matches = re.finditer(regex, test_str, re.MULTILINE)
for matchNum, match in enumerate(matches, start=1):
dict[match.group(1)] = match.group(2) + ( " " + match.group(3) if match.group(3) else "")
pp.pprint(dict)
aW1wb3J0IHJlCmltcG9ydCBwcHJpbnQKcHAgPSBwcHJpbnQuUHJldHR5UHJpbnRlcihpbmRlbnQ9NCkKcmVnZXggPSByIl5bXlxTXHJcbl0qKFxTKylbXlxkXHJcbl0rKFxkKyg/OlwuXGQrKT8pW15cZFxyXG5dKihcZCsoPzpcLlxkKyk/KT8iCmRpY3QgPSB7fQp0ZXN0X3N0ciA9ICgiICAgaFVibzIgICAgIDIxLjguICBzc29sL3QgIHZzZHcgXG4iCiAgICAgICAgICAgICIgICBBRShrKSAgICA9My4wICAgIGFzZHNkZGYvYXNcbiIKICAgICAgICAgICAgIiAgIENhdCsgICAgICAxLjEgICBmYXNkbC8gIGFvS3cgXG4iCiAgICAgICAgICAgICJHbHUgICAgICAgMzhcbiIKICAgICAgICAgICAgIkRhYyAgICAgICA8IDAuMzBcbiIKICAgICAgICAgICAgIiBESCAgICAgICAgIDcuMzUwIC0gIDcuNDUwXG4iCiAgICAgICAgICAgICIgaUtvMiAgICAgICAgMzUuMCDigJQtIDQ4LjBcbiIKICAgICAgICAgICAgIiAgTEUoZGNmKSAgICAgMi4wLSAgIDMuMFxuIgogICAgICAgICAgICAiICBMcCsgICAgICAgICAgMTM4ICB+IDE0NlxuIgogICAgICAgICAgICAiICAgQzEtICAgICAgICAgICA5OCAtIDEwNyAgICBoamtrbC9hc0wgXG4iCiAgICAgICAgICAgICIgTEt1ICAgICAgICAgICA3NCB+ICAxMDAgXG4iCiAgICAgICAgICAgICIgIEFyc2EgICAgICAgIDkuNTEgLSAxLjE5IFxuIgogICAgICAgICAgICAiICBzJDkyICAgICAgIDk0LjAgIC0gOTguMCAgICUgIikKCm1hdGNoZXMgPSByZS5maW5kaXRlcihyZWdleCwgdGVzdF9zdHIsIHJlLk1VTFRJTElORSkKCmZvciBtYXRjaE51bSwgbWF0Y2ggaW4gZW51bWVyYXRlKG1hdGNoZXMsIHN0YXJ0PTEpOgoKICAgIGRpY3RbbWF0Y2guZ3JvdXAoMSldID0gbWF0Y2guZ3JvdXAoMikgKyAoICIgIiArIG1hdGNoLmdyb3VwKDMpIGlmIG1hdGNoLmdyb3VwKDMpIGVsc2UgIiIpCgoKcHAucHByaW50KGRpY3Qp
{ 'AE(k)': '3.0',
'Arsa': '9.51 1.19',
'C1-': '98 107',
'Cat+': '1.1',
'DH': '7.350 7.450',
'Dac': '0.30',
'Glu': '38',
'LE(dcf)': '2.0 3.0',
'LKu': '74 100',
'Lp+': '138 146',
'hUbo2': '21.8',
'iKo2': '35.0 48.0',
's$92': '94.0 98.0'}