import res='Black<5,4>, Black<9,4>'print([(x, map(int, y.split(','))) for x,y in re.findall(r'(\w+)<([^<>]+)>', s)])
Standard input is empty
[('Black', [5, 4]), ('Black', [9, 4])]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!