|
Boost Users : |
From: Ferdinand Prantl (ferdinand.prantl_at_[hidden])
Date: 2003-05-20 02:41:48
Hi Mark,
boost::regex_match requires the regex to match the _whole_ string, use
another regex - "^Now.*$" - or another method - boost::regex_search.
See the documentation:
http://www.boost.org/libs/regex/template_class_ref.htm#query_match
http://www.boost.org/libs/regex/template_class_ref.htm#reg_search
Ferda
-----Original Message-----
From: Mark Sizer [mailto:yg-boost-users_at_[hidden]]
Sent: Tuesday, May 20, 2003 01:25
To: boost-users_at_[hidden]
Subject: [Boost-Users] newbie regex problem
Everything builds and runs fine, I'm just not getting the result I expect.
std::string sString = "Now is the time for all good men..."; std::string
sRegEx1 = "^Now";
boost::regex regex1( sRegEx1 );
CPPUNIT_ASSERT( boost::regex_match(sString, regex1) );
is failing.
I have to assume I'm doing something really stupid. Could someone tell
me what?
Thanks,
- Mark
------------------------ Yahoo! Groups Sponsor ---------------------~--> Get
A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/EbFolB/TM
---------------------------------------------------------------------~->
Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
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