title: Capturing subset of a string using Python's regex
body: <p>I have a string that looks like this:</p>
  
  <pre><code>&gt;Bounded_RNA_of:1DDL:Elength : 1
  </code></pre>
  
  <p>Regex wise it can be formed this way:  </p>
  
  <pre><code>&gt;Bounded_RNA_of:(\w+):(\w)length : 1
  </code></pre>
  
  <p>At the end of the day what I want to extract is just <code>1DDL</code> and <code>E</code>.</p>
  
  <p>But why this regex failed?</p>
  
  <pre><code>import re
  seq="&gt;Bounded_RNA_of:1DDL:Elength : 1"
  match = re.search(r'(&gt;Bounded_RNA_of:(\w+):(\w)length : 1)',seq)
  print match.group()
  
  # prints this:
  # &gt;Bounded_RNA_of:1DDL:Elength : 1
  </code></pre>
  
  <p>What's the way to do it?</p>