From b88d1bad88ac22a97c5cd2f56100ec23c1400cf0 Mon Sep 17 00:00:00 2001 From: Benson Liu Date: Fri, 19 Jul 2024 08:56:51 -0700 Subject: [PATCH] fix: regex edge case --- solver/passes/z3_pass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solver/passes/z3_pass.py b/solver/passes/z3_pass.py index 01cc019..c55d551 100644 --- a/solver/passes/z3_pass.py +++ b/solver/passes/z3_pass.py @@ -34,7 +34,7 @@ def run_pass(ast: Expr) -> Expr: # this is a hack to fix that # Pattern to match "Xor(A, B)" - pattern = r"Xor\(([A-Z \|&\^\(\)]+), ([A-Z \|&\^\(\)]+)\)" + pattern = r"Xor\(([A-Z \|&!\^\(\)]+), ([A-Z \|&!\^\(\)]+)\)" # Replacement string using backreferences to capture groups replacement = r"\1 ^ \2" # Performing the replacement. Loop to catch nested Xor calls