import ref = "abc_xyz1024X137M4B4abc_xyz"print(re.findall(r"(\d+)X(\d+)", f))m = re.search(r"(?P<x>\d+)X(?P<y>\d+)", f)if m: print(m.groupdict())
Standard input is empty
[('1024', '137')] {'y': '137', 'x': '1024'}
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!