title: c++: no instance of overloaded function "regex_search" matches the argument list
body: <p>For my c++ class, we have been given a "simple regular expression assignment".  But every time I try to use regex_search() in Visual Studio Community 2015, I get "no instance of overloaded function "regex_search" matches the argument list". I mouse-over the error, and it tells me it wants (for one example) string, smatch, string; which is exactly what I give it.  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>include &lt;iostream&gt;
  include &lt;string&gt;
  include &lt;regex&gt;
  
  using namespace std;
  
  int main( int argc, char *argv[] )
  {
      string regexCriteria1 = "\\.$";
      string test = "asdf.";
      smatch searchResult;
  
      for each ( string line in quotes ) // I have also tried const auto &amp;line in quotes
      {
          cout &lt;&lt; regex_search( line, regexCriteria1 ) &lt;&lt; endl;
          regex_search( line, searchResult, regexCriteria1 );
          regex_search( line.begin(), line.end(), searchResult, regexCriteria1 );
      }
      regex_search( test, searchResult, regexCriteria1 );
  }
  </code></pre>
  
  <p>I have no idea why none of these regex_search() lines are working.  This was supposed to be a 45 minute project, it has already taken me over 2 hours, and I am nowhere near done.  This would have only taken me 5 minute in Java.  Any help would be greatly appreciated.  My wife is starting to fear for my sanity.</p>