Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::regex - I do not understand why this testfails.
From: Mauricio Gomes (mgpensar_at_[hidden])
Date: 2010-06-23 14:00:03


static const std::string& REGEX1 =
"\\s*(\\w+){1}\\s+([\\d,\\.]+){1}\\s+([\\d,\\.]+){1}\\s+([\\d,\\.]+)\\s*$";

2010/6/23 John Maddock <boost.regex_at_[hidden]>:
>
> Ugh?  REGEX1 will match a string containing *one* word (the "(\\w+)" part),
> followed by three numbers which may also contain any number of "."'s or
> ","'s.  And that's exactly what it's doing isn't it?
>
> Maybe I've missed something?  John.

Hi John, my idea was to match numbers with US and Brazilian decimal
and grouping chars.
So it should match 2,000,000.00 and 2.000.000,00.
Again, I am a beginner with regex so if you have a suggestion to do
that in a more efficient or simpler way please feel free to do so.

Obs.: in the previous message I posted the code fixed by Steven suggestion.

Thank you for your attention,
Mau.

-- 
Mau

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