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