Boost C++ Libraries: Ticket #5852: boost::xpressive::sregex::compile https://svn.boost.org/trac10/ticket/5852 <p> Hi, </p> <p> please run very simple program attached and see why it doesnt match result in one instance while it correctly does in the other instance (commented out). </p> <p> Thanks Ivan </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5852 Trac 1.4.3 anonymous Thu, 01 Sep 2011 13:40:24 GMT attachment set https://svn.boost.org/trac10/ticket/5852 https://svn.boost.org/trac10/ticket/5852 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Makefile</span> </li> </ul> Ticket anonymous Thu, 01 Sep 2011 13:40:46 GMT attachment set https://svn.boost.org/trac10/ticket/5852 https://svn.boost.org/trac10/ticket/5852 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Aksel.cpp</span> </li> </ul> Ticket Eric Niebler Fri, 02 Sep 2011 22:09:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5852#comment:1 https://svn.boost.org/trac10/ticket/5852#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> You are using the wrong algorithm. <code>regex_match</code> only succeeds if it consumes the whole input, which the first pattern does. <code>regex_search</code> will find the pattern anywhere in the input string. You should use <code>regex_search</code>. (And read the docs. ;-)) </p> Ticket