title: Retrieving a regex search in C++
body: <p>Hello I am new to regular expressions and from what I understood from the c++ reference website it is possible to get match results.</p>
  
  <p>My question is: how do I retrieve these results? What is the difference between <code>smatch</code> and <code>cmatch</code>? For example, I have a string consisting of date and time and this is the regular expression I wrote:</p>
  
  <pre><code>"(1[0-2]|0?[1-9])([:][0-5][0-9])?(am|pm)"
  </code></pre>
  
  <p>Now when I do a <code>regex_search</code> with the string and the above expression, I can find whether there is a time in the string or not. But I want to store that time in a structure so I can separate hours and minutes. I am using Visual studio 2010 c++.</p>