fork download
  1. import re
  2.  
  3. pattern = r"'Field':\s+'\[([0-9]+,\s*[0-9]+)]'"
  4.  
  5. s = "{'Port': '2', 'Array': '[0, 0]', 'Field': '[2,2]', 'foo': '[0, 0]' , 'bar': '[9, 9]'}"
  6.  
  7. m = re.search(pattern, s)
  8. if m:
  9. print(m.group(1))
  10.  
Success #stdin #stdout 0.03s 9516KB
stdin
Standard input is empty
stdout
2,2