Boost logo

Boost Users :

From: Kalin Nakov (kalin.nakov_at_[hidden])
Date: 2007-04-25 04:56:54


Hi,

I experience big troubles with regex matching. The code below should
obviously match 'abc', but does not, because it tries to match the whole
string. If r='abcdefg', then match is successfull, but if it is only 'abc'
and input is 'abcdef', the match always fails as described below.

boost::match_results<std::string::const_iterator> m;
std::string inp = "abcdefg";
boost::regex r = "abc";
if (!boost::regex_match(inp, m, r, boost::match_default))
   // always fails, don't know why

How can I successfully match 'abc' agains input 'abcdefg'?

Thank you very much in advance,
Kalin



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