Boost logo

Boost Users :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2006-03-22 11:44:19


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net