Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2004-08-13 05:39:54

> After some seven thousands hits the match algo throughs the memory
exhausted exception.
> So I cought the exception and moved the iterator by one, printed the
location it points to in my searched file to view the problematic section
for the regex find algorithm.
> I have noticed that the problem happens not with all large files, but with
quite a bit of them.
> After I have received the problematic section in my file, I ran the
program on it and it did not raise any exceptions.
> Please , help me I have a Graduate project to complete within 3 weeks
from now, and this is one of the major bugs I have not resolved.

You don't say *exactly* what the regex is that's causing the problem - it
makes a difference - problems like this are usually caused by an expression
that behaves badly with specific input (because regexes are NP-Hard to match
in the general case). Boost.Regex will throw an exception rather than go on
thrashing forever trying to find a match, but to determine whether this is
the case here, you need to trap the exception at the point it's being
thrown, and see if the regex lib is indeed the culprit, if it is, then
refactoring the expression that you're using so that it's less ambiguous is
usually the answer.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at