
22 Mar
2006
22 Mar
'06
4:44 p.m.
Christian Henning wrote:
Andrew, the following code is not working on my machine. Can you check if it is on your machine, please? The size of the match container is just one. I'm using VC7.1 and Boost 1.33.1.
int _tmain(int argc, _TCHAR* argv[]) { //second approach boost::regex oDateReg2( "\\d{2}-\\d{2}-\\d{4}" ); std::string strDate2( "11-22-1997" );
This regular expression does not contain captures. The size of the match container is supposed to be 1. Try this instead: boost::regex oDateReg2( "(\\d{2})-(\\d{2})-(\\d{4})" ); Sebastian Redl