title: QRegExp not extracting text as expected
body: <p>I am trying to extract text from between square brackets on a line of text.   I've been messing with the regex for some time now, and cannot get what I need.  (I can't even explain why the output is what it is).  Here's the code:</p>
  
  <pre><code>QRegExp rx_timestamp("\[(.*?)\]");
  int pos = rx_timestamp.indexIn(line);
  if (pos &gt; -1) {
      qDebug() &lt;&lt; "Captured texts: " &lt;&lt; rx_timestamp.capturedTexts();
      qDebug() &lt;&lt; "timestamp cap: " &lt;&lt;rx_timestamp.cap(0);
      qDebug() &lt;&lt; "timestamp cap: " &lt;&lt;rx_timestamp.cap(1);
      qDebug() &lt;&lt; "timestamp cap: " &lt;&lt;rx_timestamp.cap(2);
  } else qDebug() &lt;&lt; "No indexin";
  </code></pre>
  
  <p>The input line is:</p>
  
  <pre><code>messages:[2013-10-08 09:13:41] NOTICE[2366] chan_sip.c: Registration from '"xx000 &lt;sip:xx000@183.229.164.42:5060&gt;' failed for '192.187.100.170' - No matching peer found
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>Captured texts:  (".") 
  timestamp cap:  "." 
  timestamp cap:  "" 
  timestamp cap:  "" 
  </code></pre>
  
  <ol>
  <li>Can someone explain what is going on?  Why is cap returning "." when no such character exists between square brackets</li>
  <li>Can someone correct the regex to extract the timestamp from between the square brackets?</li>
  </ol>