Boost C++ Libraries: Ticket #946: regexp enters in a infinite loop https://svn.boost.org/trac10/ticket/946 <pre class="wiki">In the code below the regular expression fain to pass the line regex.Search(). So the line with if instruction will never be reached. const char* szExpr = "([A-Z][a-z\\, ]+)+"; const char* szData = "continent mostly south of the Antarctic Circle etc"; boost::RegEx regex(szExpr, true); bool bFound = regex.Search(szData); if(bFound) cout &lt;&lt; regex[0].c_str() &lt;&lt; endl; my email address is balcanuc@yahoo.com </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/946 Trac 1.4.3 nobody Thu, 06 Sep 2001 10:54:07 GMT <link>https://svn.boost.org/trac10/ticket/946#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/946#comment:1</guid> <description> <pre class="wiki">Logged In: NO OK the problem here is that by making the expression case insensitive [A-Z] and [a-z] are the same thing. In effect you have created an expression that is more or less : (.+)+ and that is one that's well known to become pathological (if I've got this right there are in effect n! ways to locate a match using an expression like this against an n- character string). I'm going to leave this issue open though, as there should be a way to detect and abort from pathological behaviour in the regex engine. regards, John Maddock </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 30 May 2003 11:04:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/946#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/946#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=14804 The current code will detect "infinite loops" and throw and exception to break out of them. John Maddock </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 30 May 2003 11:04:06 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/946#comment:3 https://svn.boost.org/trac10/ticket/946#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket