- boost:: regex
Alternative approach:
You can use boost :: regex_iterator, this is useful for parsing a file, etc.
string[0],
string[1]
below indicates the start and end iterator.
Example:
boost::regex_iterator stIter(string[0], string[end], regExpression)
boost::regex_iterator endIter
for (stIter; stIter != endIter; ++stIter)
{
cout << " Whole string " << (*stIter)[0] << endl;
cout << " First sub-group " << (*stIter)[1] << endl;
}
}
source
share