A
ambarish.mitra
Code snippet:
#include <iostream>
#include <string>
#include <boost/regex.hpp> // Boost.Regex lib
using namespace std;
int main( )
{
std::string s, sre;
boost::regex re;
....
try
{
// Set up the regular expression for case-insensitivity
re.assign(sre, boost::regex_constants::icase);
}
// catch (boost::regex_error& e)
catch (...)
{
cout << sre << " is not a valid regular expression: \"" <<
endl;
continue;
}
...
}
This code snippet builds well with GCC g++ 3.4.5, but fails to link on
g++ 3.3.2, error being something to do with basic strings.
Is there any workaround on 3.3.2 - this is the one I have to use. I am
on boost 1.32
#include <iostream>
#include <string>
#include <boost/regex.hpp> // Boost.Regex lib
using namespace std;
int main( )
{
std::string s, sre;
boost::regex re;
....
try
{
// Set up the regular expression for case-insensitivity
re.assign(sre, boost::regex_constants::icase);
}
// catch (boost::regex_error& e)
catch (...)
{
cout << sre << " is not a valid regular expression: \"" <<
endl;
continue;
}
...
}
This code snippet builds well with GCC g++ 3.4.5, but fails to link on
g++ 3.3.2, error being something to do with basic strings.
Is there any workaround on 3.3.2 - this is the one I have to use. I am
on boost 1.32