title: regex (Regular Expression) in C++ Error: " terminate called after throwing an instance of 'std::regex_error' what(): regex_error Aborted (core dumped)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12530406/is-gcc4-7-buggy-about-regular-expressions">Is gcc4.7 buggy about regular expressions?</a>  </p>
  </blockquote>
  
  <p>I compile the code below with "g++ test.cpp -std=gnu++0x" .
  Compilation is successful but when I run./a.out it gives error like that I do not understand why it happens. My operating system s Mint.</p>
  
  <p>Error:
  "
  terminate called after throwing an instance of 'std::regex_error'
    what():  regex_error
  Aborted (core dumped)
  "</p>
  
  <pre><code>Code:
  // regex_match example
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;regex&gt;
  
  using namespace std;
  
  int main ()
  {
    string s ("this subject has a submarine as a subsequence");
    regex e("sub[a-z]");   // matches words beginning by "sub"
    smatch m;
  
    return 0;
  }
  </code></pre>