title: C++ 11 regex: checking if string starts with regex
body: <p>I am using C++ 11's <code>&lt;regex&gt;</code> support, and would like to check whether the beginning of a string matches a regular expression. [I can switch to Boost if that helps, but my impression is that they're basically the same.]</p>
  
  <p>Obviously if I have control of the actual textual representation of the expression, I can just stick a <code>^</code> at the beginning of it as an anchor.</p>
  
  <p>However, what if I just have a <code>regex</code> (or <code>basic_regex</code>) object? Can I modify the regular expression it represents to add the anchor? Or do I have to use <code>regex_search</code>, get the result, and check whether it starts at position 0?</p>