Boost C++ Libraries: Ticket #671: regex_match fails, but regex_search works fine https://svn.boost.org/trac10/ticket/671 <pre class="wiki">I encountered this when I tried to upgrade from 1.32 to 1.33.1 I search through a text with regex_search, and pass the results to regex_match. I would expect them to yield the same result, but they don't. Here is a sample code: std::string pattern = "xx-{0,2}([+-][0-9])?"; boost::regex reg(pattern.begin(), pattern.end (), boost::regex::perl_syntax_group ); char* buf = "xx-- "; boost::cmatch what; regex_search(buf,what,reg, boost::regex_constants::match_default); bool match = regex_match(what[0].first, what [0].second,reg, boost::regex_constants::match_any); regex_search returns the [0,4), as I expected, but regex_match returns false! Am I doing something wrong? Is there a workaround? Thanks, Moddy. moddyt@itemfield.com </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/671 Trac 1.4.3 John Maddock Sat, 08 Jul 2006 11:50:30 GMT <link>https://svn.boost.org/trac10/ticket/671#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/671#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=14804 I've confirmed this as a bug in the current release, you could try defining BOOST_REGEX_NON_RECURSIVE in boost/regex/user.hpp as a temporary workaround and rebuilding everything (including the library). </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 10 Jul 2006 13:09:39 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/671#comment:2 https://svn.boost.org/trac10/ticket/671#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=14804 This is now fixed in cvs. </pre> Ticket