title: c++ regex pattern to check file extension
body: <p>I want to check if a string ends with .h5 and tried the c++ regex class. But for any Input the regex_search function returns false. Other examples in the internet looks similar to my code below, so I do not understand whats going wrong.</p>
  
  <p>What is wrong with my code? Thanks for any help.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;regex&gt;
  #include &lt;string&gt;
  
  int main(int argc,char *argv[]){
  
    std::string text = argv[1];
  
    std::regex rx(".*\\.h5$");
    bool found = std::regex_search(text.c_str(),rx);
  
    std::cout &lt;&lt; text &lt;&lt; std::endl;
    std::cout &lt;&lt; "res: " &lt;&lt; found &lt;&lt; std::endl;
  
  
  }
  </code></pre>