Hello, I want to report a problem with Regex library. 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 iterations. 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. Thanks, Evgeny ***************************** Finjan Software This e-mail and any attached files are confidential and may be legally privileged. The unauthorized use, disclosure or copying of this email or any information contained within it is strictly prohibited. This also confirms that Finjan Software's Vital Securityfor E-Mail has scanned this message for the presence of known viruses and potentially malicious code. Finjan Software - Prevention is the Best Cure! *****************************
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 iterations. 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.
participants (2)
-
Evgeny Benediktov
-
John Maddock