From c339194c02d7bfb883131da2eb176a6a4b061ab5 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 22 Nov 2016 15:42:35 -0300 Subject: [PATCH] Changes operator rx to use regexp::searchAll --- src/operators/rx.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/operators/rx.cc b/src/operators/rx.cc index 31721f6c..74464b76 100644 --- a/src/operators/rx.cc +++ b/src/operators/rx.cc @@ -28,15 +28,21 @@ namespace operators { bool Rx::evaluate(Transaction *transaction, const std::string& input) { SMatch match; + std::list matches; if (m_param.empty()) { return true; } - if (regex_search(input, &match, *m_re) && match.size() >= 1) { + matches = m_re->searchAll(input); + for (const SMatch& a : matches) { if (transaction) { - transaction->m_matched.push_back(match.match); + transaction->m_matched.push_back(a.match); + transaction->debug(7, "Added regex subexpression: " + a.match); } + } + + if (matches.size() > 0) { return true; }