title: REGEX: how to match the syntax ?
body: <p>I have a Bug at my simple REGEX. 
  I have been trying to write some simple regular expressions at C++ using <code>std::regex</code>. Here is my code so far.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;regex&gt;
  #include &lt;string&gt;
  
  int main(void)
  {
      std::string str = "Hello world";
      std::regex rx("\w+\s\w+"), rx2("ello");
      std::cout &lt;&lt; std::boolalpha &lt;&lt; std::regex_match(str.begin(), str.end(), rx) &lt;&lt; "\n";
      std::cout &lt;&lt; std::boolalpha &lt;&lt; std::regex_search(str.begin(), str.end(), rx2) &lt;&lt; "\n";
      return 0;
  }
  </code></pre>
  
  <p>This program should print (according to a tutorial)</p>
  
  <pre><code>true
  true
  </code></pre>
  
  <p>but it prints</p>
  
  <pre><code>false
  false
  </code></pre>
  
  <p>Where am I making a mistake? Thanks in advance.</p>
  
  <p><strong>Note:</strong> I'm using <code>g++ -std=c++0x %file.cpp% -o %file%</code> if it helps</p>