2253. [func] fdupont
Added the predicate token "match" which evaluates regular
- expression matching.
+ expression matching to classification expression.
(Gitlab #3170)
2252. [bug] fdupont
Detected invalid regular expressions are considered as syntax errors,
runtime exceptions during match are handled as no match.
- Be careful with the match operator as it can show extremely bad
+ Be careful with the match operator as it can result in very poor
performance leading to regular expression denial of service (ReDoS).
with the popped value. The result was pushed onto the value stack.
% EVAL_DEBUG_MATCH_ERROR Matching '%1' on %2 raised an error: %3
-This error message indicates that the given regular expression was matched
-with the popped value. An error was raised.
+This error message indicates that an error occurred while evaluating the given
+regular expression against the popped value.
# For use with TokenMember
///
/// @param reg_exp regular expression
/// @param value value to match
- /// @param matched true or false
+ /// @param matched expected outcome of the match
void testMatch(const std::string& reg_exp, const std::string& value,
bool matched) {
clearStack();
/// @brief Match regular expression
///
/// Evaluation uses only the last parameter (top of stack) which is popped.
- /// "true" when the regular expression or "false" otherwise is pushed.
+ /// Pushes "true" when the regular expression evaluates to true,
+ /// pushes "false" otherwise.
///
/// @param pkt (unused)
/// @param values - stack of values (1 popped, 1 pushed)