Boost logo

Boost Users :

Subject: Re: [Boost-users] pathological regex?
From: John Maddock (john_at_[hidden])
Date: 2009-08-28 04:55:25


>I use boost regex v 1.37 on Ubuntu 9.04, g++-4.3.
>Because of performance issues i replaced defaut matching algorithm to
>BOOST_REGEX_RECURSIVE but then my program dont't work properly.

How so? Do you have a test case? And more to the point, did you rebuild
the regex library with BOOST_REGEX_RECURSIVE set? If not then the program
will very likely crash. BTW the difference between the recursive and
non-recursive algorithms is usually too small to notice.

>So, is this expression pathological:
>(https?://)?([^/@]*[\\.@])?google.com[/\\?&#]*

Superficially it look OK to me... but there is no such thing as a
pathological expression on it's own: it's the combination of the pattern and
the text being matched that can become pathological. The only problem case
that springs to mind in that pattern would be long sequences of .'s but I
could be wrong. Do you have a test case you can post so I can debug things
here?

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net