mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Fix regex conditions returning true for partial matches
The regex engine implicitly adds .*? to the beginning and end of expressions, so add ^ and $ to input expressions.
This commit is contained in:
+1
-1
@@ -464,7 +464,7 @@ mod tests {
|
||||
let error = Expression::from_str("file(\"Carg\\.*(\")").unwrap_err();
|
||||
|
||||
assert_eq!(
|
||||
"An error was encountered while parsing the expression \"Carg\\.*(\": regex parse error:\n Carg\\.*(\n ^\nerror: unclosed group",
|
||||
"An error was encountered while parsing the expression \"Carg\\.*(\": regex parse error:\n ^Carg\\.*($\n ^\nerror: unclosed group",
|
||||
error.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user