title: REGEXP Non Capturing Group is Capturing with TCL
body: <p>I have data, see below, that I want to parse using REGEXP in my TCL script:</p>
  
  <pre><code>Mar 31 11:30:00 UTC+0100 2015
  Mar 31 17:00:00 UTC+0100 2015
  Mar 31 17:30:00 UTC+0100 2015
  Apr 1 11:30:00 UTC+0100 2015
  Apr 1 17:00:00 UTC+0100 2015
  Apr 1 17:30:00 UTC+0100 2015
  Apr 2 11:30:00 UTC+0100 2015
  </code></pre>
  
  <p>I want to just pull out the day of the month from the data above.
  This is the regular expression I have come up with so far and I don't know why it's not working. </p>
  
  <pre><code>(?:\w{3}\s)(\d{1,2})(?:\s)
  </code></pre>
  
  <p>I have tested it on the RegExr site with my sample data and it appears to work correctly there; it returns the day of the month in the group but when I run it in my TCL script it returns all of the match, i.e. the non capturing groups are being returned.</p>
  
  <p>Is there something I'm missing here? I'm not great with regular expressions.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Below is the code sample from my script. I have a CSV file that I am reading from where sData6 column contains the date/time information above.</p>
  
  <pre><code>while {[gets $fInputFile line] &gt;= 0} {
      set aAllOptions [split $line ,]
      lassign $aAllOptions sData1 sData2 sData3 sData4 sData5 sData6
  
      regexp -all {(?:\w{3}\s)(\d{1,2})(?:\s)} $sData6 regexData6
  
      puts "Printing regexp value $regexData6\n"
  </code></pre>
  
  <p>My puts statement is returning:</p>
  
  <pre><code>Mar 31 
  </code></pre>
  
  <p>I want it for just return:</p>
  
  <pre><code>31
  </code></pre>