fork download
  1. import re
  2. rx = r'[,;" ]([^/,;" ]+/[^/,;" ]+)'
  3. s = """['"text/html,application/xhtml+xml,application/xml;q=0.9;q =0.8"']\n;q=0.9,lol/lol;"""
  4. res = re.findall(rx, s)
  5. print(res)
  6.  
Success #stdin #stdout 0.01s 6872KB
stdin
Standard input is empty
stdout
['text/html', 'application/xhtml+xml', 'application/xml', 'lol/lol']