I have a string like this:
str = "something move 11 something move 12 something 13 copy 14 15"
where the "something" means some text, or no text at all.
and as a result I want to have a list like:
[('move', 11, ''), ('move', 12, 13), ('copy', 14, 15)]
I tried using this:
re.findall('(move|copy).+?([0-9]+).+?([0-9]+)*', str)
but it gives my the output:
[('move', 11, ''), ('move', 12, ''), ('copy', 14, '')]
I understand that is because the last number is optional, but I just have no idea how I could it get working.
How can I do this?