import rerx = r"(.*?)\s*(\d+) Kill\(s\)\s*"s = "Abc - 33 SR 11 Kill(s) P G - (Type-1P-G) 2 Kill(s) M 1 Kill(s) S - M9A CWS 1 Kill(s) 11 Kill(s)"print(re.findall(rx, s))
Standard input is empty
[('Abc - 33 SR', '11'), ('P G - (Type-1P-G)', '2'), ('M', '1'), ('S - M9A CWS', '1'), ('', '11')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!