Boost C++ Libraries: Ticket #2518: RegEx with $ anchor not Perl-compatible https://svn.boost.org/trac10/ticket/2518 <p> If I try to match a string like "WORD1 WORD2" with boost::regex lastWordCapture("(<br />w+)$"); in order to capture WORD2, the regex_match fails. If I modify the regex to ".*?(<br />w+)$", it works fine. The following Perl code captures and prints WORD2 as expected. </p> <p> $string = "WORD1 WORD2"; if ($string =~ /(\w+)$/){ </p> <blockquote> <p> print "$1\n"; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2518 Trac 1.4.3 mgoldshteyn@… Thu, 20 Nov 2008 03:45:57 GMT <link>https://svn.boost.org/trac10/ticket/2518#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2518#comment:1</guid> <description> <p> I believe you are confusing regex_match with regex_search, which is what should have been used for the case you tried. </p> <p> Michael Goldshteyn </p> </description> <category>Ticket</category> </item> <item> <author>Chad Martin <chad.e.martin@…></author> <pubDate>Mon, 24 Nov 2008 21:12:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2518#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2518#comment:2</guid> <description> <p> You're right. I was used to the fact that Perl doesn't split those two functions up, and so I didn't expect that in Boost. Now that I understand the difference, my code works fine. </p> <p> Thanks, Chad Martin </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 26 Nov 2008 17:13:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2518#comment:3 https://svn.boost.org/trac10/ticket/2518#comment:3 <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> Ticket