Boost C++ Libraries: Ticket #4608: boost::regex accepts invalid regular expressions like "\\d++" https://svn.boost.org/trac10/ticket/4608 <p> In programming languages that don't support possessive quantifier,eg. Python and C#,"\d++" is considered as an illegal nested quantifier.And in boost::xpressive,"<br />d++" will raise a runtime exception.However,it's valid in boost::regex. </p> <pre class="wiki">wchar_t* s = L"abc123" ; wregex e(L"\\d+++", boost::regex::normal) ; wcmatch m ; if(regex_search(s, m, e)){ wcout &lt;&lt; m[0] &lt;&lt; endl ; } </pre><p> The output is 123. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4608 Trac 1.4.3 gyk.net <gyk.net@…> Sun, 29 Aug 2010 07:39:14 GMT <link>https://svn.boost.org/trac10/ticket/4608#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4608#comment:1</guid> <description> <p> Compiler:Visual C++ 2008 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 31 Aug 2010 08:51:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4608#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4608#comment:2</guid> <description> <p> Boost.Regex is intended to to track the regular expressions supported by Perl-5.x, and pocessive quantifiers were introduced in Perl-5.10 which is why we support them. </p> <p> However, you are correct that three +'s sould raise an error - I'll fix that shortly. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 31 Aug 2010 11:26:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4608#comment:3 https://svn.boost.org/trac10/ticket/4608#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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/65145" title="In Perl mode then &#34;something+++&#34; should be an error. Add the necessary ...">[65145]</a>) In Perl mode then "something+++" should be an error. Add the necessary error handling. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4608" title="#4608: Bugs: boost::regex accepts invalid regular expressions like &#34;\\d++&#34; (closed: fixed)">#4608</a>. </p> Ticket