title: C++ to convert Boost Regex match result to other format
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5290089/how-to-convert-a-number-to-string-and-vice-versa-in-c">How to convert a number to string and vice versa in C++</a>  </p>
  </blockquote>
  
  
  
  <p>How should I convert the boost::regex match result to other format, like integer with below code?</p>
  
  <pre><code>string s = "abc123";
  boost::regex expr("(\\s+)(\\d+)");
  boost::smatch match;
  if(boost::regex_search(s, match, expr)) {
    string text(match[0]);
    // code to convert match[1] to integer
  }
  </code></pre>