Re: [Boost-bugs] [Boost C++ Libraries] #4036: hang search

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4036: hang search
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-23 16:56:15


#4036: hang search
--------------------------------------+-------------------------------------
  Reporter: propheticoleg@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: Boost 1.43.0 | Component: regex
   Version: Boost 1.42.0 | Severity: Problem
Resolution: worksforme | Keywords: regex_search
--------------------------------------+-------------------------------------
Changes (by johnmaddock):

  * status: new => closed
  * resolution: => worksforme

Comment:

 Works for me with current SVN Trunk and the simple test case below (throws
 an exception because the match takes too long to find). Please provide a
 self contained test case and details of the compiler used plus Boost
 version if you still think there is a problem.

 {{{
 // scrap.cpp : Def
 #include "stdafx.h"

 using namespace boost;
 using namespace std;

 int main()
 {
    regex e("(?:(((((((-{0,1}((([0-9][ ]{0,1}){1,}([\\.,][ ]{0,1}([0-9][
 ]{0,1}){1,}([ ]{0,1}(([\\(]([0-9]{1,3}[ ]{0,1})[\\)]))){0,1}){0,}))))[
 ]{0,1}){0,1}((îäèí|îäíà|one|äâà|äâå|two|òðè|three|÷åòûðå|four|ïÿòü|five|øåñòü|six|ñåìü|seven|âîñåìü|eight|äåâÿòü|nine|äåñÿòü|ten|îäèííàäöàòü|eleven|äâåíàäöàòü|twelve|òðèíàäöàòü|thirteen|÷åòûðíàäöàòü|fourteen|ïÿòíàäöàòü|fifteen|øåñòüíàäöàòü|sixteen|ñåìíàäöàòü|seventeen|âîñåìíàäöàòü|eighteen|äåâÿòíàäöàòü|nineteen|äâàäöàòü|twenty|òðèäöàòü|thirty|ñîðîê|forty|ïÿòüäåñÿò|fifty|øåñòüäåñÿò|sixty|ñåìüäåñÿò|seventy|âîñåìüäåñÿò|eighty|äåâÿíîñòî|ninety|ñòî|äâåñòè|òðèñòà|÷åòûðåñòà|ïÿòüñîò|øåñòüñîò|ñåìüñîò|âîñåìüñîò|äåâÿòüñîò|ñîòíÿ|ñîòíè|ñîòåí|hundred
 and|hundred|òûñÿ÷à|òûñÿ÷è|òûñÿ÷|òûñ\\.|òûñ|thousand
 and|thousand|ìèëëèîíîâ|ìèëëèîíà|ìèëëèîí|ìëí\\.|ìëí|million
 and|million|ìèëëèàðäîâ|ìèëëèàðäà|ìèëëèàðä|ìëðä\\.|ìëðä|milliard
 and|milliard|billion and|billion)[ ]{0,1}){1,})|(((((-{0,1}((([0-9][
 ]{0,1}){1,}([\\.,][ ]{0,1}([0-9][ ]{0,1}){1,}([ ]{0,1}(([\\(]([0-9]{1,3}[
 ]{0,1})[\\)]))){0,1}){0,}))))[
 ]{0,1})((îäèí|îäíà|one|äâà|äâå|two|òðè|three|÷åòûðå|four|ïÿòü|five|øåñòü|six|ñåìü|seven|âîñåìü|eight|äåâÿòü|nine|äåñÿòü|ten|îäèííàäöàòü|eleven|äâåíàäöàòü|twelve|òðèíàäöàòü|thirteen|÷åòûðíàäöàòü|fourteen|ïÿòíàäöàòü|fifteen|øåñòüíàäöàòü|sixteen|ñåìíàäöàòü|seventeen|âîñåìíàäöàòü|eighteen|äåâÿòíàäöàòü|nineteen|äâàäöàòü|twenty|òðèäöàòü|thirty|ñîðîê|forty|ïÿòüäåñÿò|fifty|øåñòüäåñÿò|sixty|ñåìüäåñÿò|seventy|âîñåìüäåñÿò|eighty|äåâÿíîñòî|ninety|ñòî|äâåñòè|òðèñòà|÷åòûðåñòà|ïÿòüñîò|øåñòüñîò|ñåìüñîò|âîñåìüñîò|äåâÿòüñîò|ñîòíÿ|ñîòíè|ñîòåí|hundred
 and|hundred|òûñÿ÷à|òûñÿ÷è|òûñÿ÷|òûñ\\.|òûñ|thousand
 and|thousand|ìèëëèîíîâ|ìèëëèîíà|ìèëëèîí|ìëí\\.|ìëí|million
 and|million|ìèëëèàðäîâ|ìèëëèàðäà|ìèëëèàðä|ìëðä\\.|ìëðä|milliard
 and|milliard|billion and|billion)[ ]{0,1}){0,}))))[
 ]{0,1}(øòóê|øò\\.|øò|åäèíèö|åä\\.|åä))(?:[^A-Za-zÀ-ßà-ÿ/]|$))");
    std::string text("The following phone numbers were returned in this
 area code:\n\n3123484973, 3123488416, 3123488393, 3123485219, 3123480807,
 3123482560, 3123483792, 3123486264, 3123484451, 3123485172, 3123486573,
 3123489859, 3123482700, 3123488701, 3123480783, 3123489095, 3123488519,
 3123480121, 3123482416, 3123489534, 3123483804, 3123488660, 3123485544,
 3123484113, 3123480599, 3123482042, 3123488537, 3123482887, 3123483914,
 3123484208, 3123482591, 3123482974, 3123488856, 3123480352,
 3123484017...");

    std::cout << regex_search(text, e) << std::endl;

 }

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4036#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC