title: I`m trying to make regular expression reader function. C++
body: <p>I have line with few words and want to place those words in vector so I can manipulate with each word as a separate object. the problem is when I use function regexp_search(string,match,regexp) after finding first match I`m trying to delete everything what was in string before found match word but calling function match.suffinx().str() returns emply string when it should return other words from that string.</p>
  
  <p>here is my regular expression : </p>
  
  <pre><code>std::regex reg("([C-Fc-f]at)");
  </code></pre>
  
  <p>here is my function :</p>
  
  <pre><code>std::vector&lt;string&gt; stringToVector(string str, regex reg){
  cout &lt;&lt; boolalpha;
  vector&lt;string&gt; vec;
  smatch match;
  
  
  while (regex_search(str, match, reg))
  {
      vec.push_back(match.str(1));
      str = match.suffix().str();
  }
  return vec;}
  </code></pre>