Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2004-08-12 05:04:25

>When extensive usage of regex_match and regex_search functions is done
numerous times, then after several thousands iterations >Regex library
starts throwing "Regular expression too big" exception on the same regular
expressions it worked perfectly with at >several thousands previous
>Looks like Regex fails to do some vital clean up.
>If anyone saw this problem before, or has any suggestion about it, this may
be very helpful.

It's most likely that those exceptions are coming from the matching
algorithms (regex_match/regex_search)? If so then it's because the
combination of the particular regular expression, and the particular text
being matched, were becoming "pathological", so an exception is thrown to
prevent the match taking forever to obtain (regexes are NP-Hard to match in
the worst case). Often these issues can be resolved by refactoring the
regular expression, but you really need to track down which specific
expression, against what specific text is causing the problem - try setting
your debugger to break when an exception is thrown, and then work back up
the stack to see what caused the issue.

John Maddock.

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