From dbe655d159998b7dd0f75cca75129a8e7ee1f8d1 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 15 Aug 2015 17:02:26 +0200 Subject: [PATCH] regex filter: log the problematic strings so they can be identified --- src/regex_filter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/regex_filter.h b/src/regex_filter.h index a0bbabcf..8b3f3c0a 100644 --- a/src/regex_filter.h +++ b/src/regex_filter.h @@ -30,6 +30,7 @@ #endif // BOOST_REGEX_ICU #include +#include namespace Regex { @@ -64,8 +65,9 @@ inline bool search(StringT &&s, const Regex &rx) boost::regex_search # endif // BOOST_REGEX_ICU (std::forward(s), rx); - } catch (std::out_of_range &) { + } catch (std::out_of_range &e) { // Invalid UTF-8 sequence, ignore the string. + std::cerr << "Regex::search: error while processing \"" << s << "\": " << e.what() << "\n"; return false; } }