title: QRegExp Extract Two Numbers
body: <p>All I am trying to extract two numbers from a user string.  I have the regexp working, but the second number capture is not being greedy enough!  I can't figure out how to reformat this to my needs, I am submitting my reg exp any advice would be great!</p>
  
  <pre><code>QRegExp valid_input(".*(-?\\d*\\.?\\d+)[\\s,]+(-?\\d*.?\\d+)[^\d]*");
  valid_input.setMinimal(true);
  
  if(valid_input.indexIn(value.toString()) == -1)
      return false;
  
  QPointF new_point(valid_input.cap(1).toDouble(), valid_input.cap(2).toDouble());
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <hr>
  
  <p><strong>Example input:</strong> <code>156, 264</code></p>
  
  <p><strong>Expected Output:</strong> <code>156</code> and <code>264</code></p>
  
  <p><strong>My Output:</strong> <code>156</code> and <code>2</code></p>
  
  <hr>
  
  <p><strong>Example input:</strong> <code>156.2 264.52</code></p>
  
  <p><strong>Expected Output:</strong> <code>156.2</code> and <code>264.52</code></p>
  
  <p><strong>My Output:</strong> <code>156</code> and <code>2</code></p>
  
  <hr>
  
  <p><strong>Example input:</strong> <code>156.2 264.52)</code></p>
  
  <p><strong>Expected Output:</strong> <code>156.2</code> and <code>264.52</code></p>
  
  <p><strong>My Output:</strong> <code>156</code> and <code>2</code></p>