import res = "107S33M15H\n33M100S\n12M100H33M"print(re.findall(r"(\d+)M", s))
Standard input is empty
['33', '33', '12', '33']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!