Opened 18 years ago

Closed 18 years ago

#269 closed Bugs (Rejected)

recursive matching for regular expression fails.

Reported by: nobody Owned by: John Maddock
Milestone: Component: regex
Version: None Severity:
Keywords: Cc:

Description

I am looking for regular expression
"http://\([^ ]+\)+"

in a buffer containing following text
http://business.jet2web.at. 

and it failes in file

"perl_matcher_non_recursive.hpp"

function 

match_all_states()
{
   ......

 if(state_count > max_state_count)
      raise_error(traits_inst, REG_ESPACE);   
  
}

I work with bersion BOOST 1.31 in Visual Studio .NET 
2003.

My User.hpp is attached.

I set following flags of compilation:

boost::regbase::flag_type reg_flags = 
boost::regbase::char_classes | 
		boost::regbase::escape_in_lists | 
boost::regbase::bk_parens | boost::regbase::intervals;
 
Maya

Change History (1)

comment:1 by John Maddock, 18 years ago

Status: assignedclosed
Logged In: YES 
user_id=14804

It's not a bug (honest), the basic problem is that your 
expression is basically the same form as:

(.*)*

which is known to become pathological very quickly; the 
thrown exception is intended to prevent the expression from 
taking an eternity trying to find a match.  The alternative 
expression:

"http://\([^ ]+\)"

would actually do exactly the same thing, but does not get 
pathological.

John Maddock
Note: See TracTickets for help on using tickets.