title: Regex in C++: Requires compiler support error
body: <p>I'm trying to use <code>regex</code> in C++. The following is my code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;string.h&gt;
  #include&lt;regex&gt;
  using namespace std;
  
  int main(int argc, char** argv) {
      string A = "Hello!";
      regex pattern = "(H)(.*)";
      if (regex_match(A, pattern)) {
          cout &lt;&lt; "It worked!";
      }
      return 0;
  }
  </code></pre>
  
  <p>But I'm encountering this error :</p>
  
  <pre><code>In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/regex:35:0,
                   from main.cpp:12:
  /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
  </code></pre>
  
  <p>How can this be solved and what is wrong?</p>