title: Python regex returning one group instead of two. What am I missing here?
body: <p>Let's say that I have a variable that can either be in the format of:</p>
  
  <pre><code>[+] Software in use: Calculator
  </code></pre>
  
  <p>or, in some cases, the software version number is shown:</p>
  
  <pre><code>[+] Software in use: Calculator - v2.3
  </code></pre>
  
  <p>I am attempting to capture 1) the software name, and 2) if provided, the version number.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>line = '[+] Software in use: Calculator - v2.3'
  searchObj = re.search('\[\+\] Software in use: (.+)( - v(\d+.\d+))?', line)
  </code></pre>
  
  <p><code>searchObj.group(1)</code> returns the entire "Calculator - v2.3" Why is regex not splitting them up into groups? <code>searchObj.group(2)</code>, <code>searchObj.group(3)</code> does not exist. I thought that parenthesis signified a capture group. Am I overlooking something?</p>