Modify

Ticket #4036 (closed Bugs: worksforme)

Opened 4 years ago

Last modified 4 years ago

hang search

Reported by: propheticoleg@… Owned by: johnmaddock
Milestone: Boost 1.43.0 Component: regex
Version: Boost 1.42.0 Severity: Problem
Keywords: regex_search Cc:

Description

The string with many numbers and not simple expression on numbers will hang search without any messages or exceptions.

Attachments

document.txt Download (485 bytes) - added by propheticoleg@… 4 years ago.
document wirh analyzing text
regular expression.txt Download (1.8 KB) - added by propheticoleg@… 4 years ago.
regular expression for analyzing

Change History

Changed 4 years ago by propheticoleg@…

document wirh analyzing text

Changed 4 years ago by propheticoleg@…

regular expression for analyzing

comment:1 Changed 4 years ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to worksforme

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;

}

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.