Change string contains operators to regex (#5117)

This commit is contained in:
Reilly Wood
2022-04-06 23:23:14 -07:00
committed by GitHub
parent 888369022f
commit b2c52b51b7
11 changed files with 130 additions and 43 deletions

View File

@ -405,13 +405,13 @@ pub fn eval_expression(
let rhs = eval_expression(engine_state, stack, rhs)?;
lhs.not_in(op_span, &rhs)
}
Operator::Contains => {
Operator::RegexMatch => {
let rhs = eval_expression(engine_state, stack, rhs)?;
lhs.contains(op_span, &rhs)
lhs.regex_match(op_span, &rhs, false)
}
Operator::NotContains => {
Operator::NotRegexMatch => {
let rhs = eval_expression(engine_state, stack, rhs)?;
lhs.not_contains(op_span, &rhs)
lhs.regex_match(op_span, &rhs, true)
}
Operator::Modulo => {
let rhs = eval_expression(engine_state, stack, rhs)?;