fork download
  1. import re
  2. s="a=fmtp:96 mode-change-period=1; mode-change-capability=2; mode-change-neighbor=0; max-red=0; octet-align=0"
  3. m = re.search(r'fmtp:\d{2,3}\s*(.*)', s)
  4. if m:
  5. print("The text extracted: {}".format(m.group(1)))
  6. dt = dict([x.split("=") for x in m.group(1).split("; ")])
  7. print("The list of attribute values: {}".format(dt))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
The text extracted: mode-change-period=1; mode-change-capability=2; mode-change-neighbor=0; max-red=0; octet-align=0
The list of attribute values: {'octet-align': '0', 'max-red': '0', 'mode-change-capability': '2', 'mode-change-period': '1', 'mode-change-neighbor': '0'}