fork download
  1. import re
  2.  
  3. a=97
  4. regex = r"\S(?: \S)*"
  5. test_str = "a b d d c"
  6. matches = re.findall(regex, test_str)
  7. chars = list(map(chr, range(a, a+len(matches))))
  8. print(dict(zip(chars, matches)))
Success #stdin #stdout 0.02s 27776KB
stdin
Standard input is empty
stdout
{'c': 'c', 'b': 'b d d', 'a': 'a'}