title: tokenizing a comma separated list using std regex
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;regex&gt;
  #include &lt;sstream&gt;
  #include &lt;vector&gt;
  
  std::vector&lt;std::string&gt; split(const std::string &amp;str) {
    std::regex rgx("");  //what goes here??
    std::smatch base_match;
    std::regex_search(str, base_match, rgx);
    return {base_match.begin(), base_match.end()};
  }
  
  std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os,
                           const std::vector&lt;std::string&gt; &amp;strs) {
    for (const auto &amp;str : strs) {
      os &lt;&lt; "-&gt; " &lt;&lt; str &lt;&lt; "\n";
    }
    return os;
  }
  
  int main(int argv, char **argc) {
    std::cout &lt;&lt; split("asdasd,dasdasd,adadada");
    return 0;
  }
  </code></pre>
  
  <p>I want to have a regex solution (without using the sregex_token_iterator or boost) that gives sub-matches for a comma separated list and skips the commas (and spaces after/before commas too).</p>
  
  <pre><code>expected output:
  asdasd
  dasdasd
  adadada
  </code></pre>