cpp cmatch what;
if (regex_match("one two three", what, regex("one (.*) three")))
cout << what[1] << endl;
// must link with boost_regex or boost_regex-mt (multithread-safe) library
#include <iostream>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main()
{
cmatch what;
if (regex_match("one two three", what, regex("one (.*) three")))
cout << what[1] << endl;
}