fork download
  1. import re
  2. f = "abc_xyz1024X137M4B4abc_xyz"
  3. print(re.findall(r"(\d+)X(\d+)", f))
  4. m = re.search(r"(?P<x>\d+)X(?P<y>\d+)", f)
  5. if m:
  6. print(m.groupdict())
Success #stdin #stdout 0.05s 9460KB
stdin
Standard input is empty
stdout
[('1024', '137')]
{'y': '137', 'x': '1024'}