title: python recursive regular expression
body: <p>I have a message that is </p>
  
  <pre><code>msg = 'untagged ethernet 1 ethernet 2 ethernet 3'
  </code></pre>
  
  <p>and I want to write a regex that will find the 'ethernet x' pattern so that if i run</p>
  
  <pre><code>m = re.match(str(regex),msg) 
  print m.groups()
  </code></pre>
  
  <p>it will save the variable x and display something like </p>
  
  <pre><code>(1,2,3)
  </code></pre>
  
  <p>the expression that I have tried is </p>
  
  <pre><code>regex = 'untagged ((?: ethernet (\S+))*)'
  </code></pre>
  
  <p>but i am getting </p>
  
  <pre><code>('ethernet 1', 'ethernet 1', '1')\
  </code></pre>
  
  <p>as a result</p>