RE: [Boost-Users] newbie regex problem

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@gmane.org] Sent: Tuesday, May 20, 2003 01:25 To: boost-users@yahoogroups.com 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@yahoogroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
participants (1)
-
Ferdinand Prantl