This regex will trim the string at line breaks.
I want it to trim both end only and preserve any line breaks in the middle.
string s(" Stack \n Overflow ");
boost::regex expr("^[ \t]+|[ \t]+$");
std::string fmt("");
cout << boost::regex_replace(s, expr, fmt) << endl;