From 57842b0c862be667639ea21d46991fd132d5b835 Mon Sep 17 00:00:00 2001 From: dm Date: Wed, 5 Jun 2024 18:56:57 +0200 Subject: [PATCH] Fix regex patterns (#2442) --- slither/solc_parsing/expressions/expression_parsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index 4991984ff..afa5c367b 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -501,7 +501,9 @@ def parse_expression(expression: Dict, caller_context: CallerContextExpression) referenced_declaration = expression["attributes"]["referencedDeclaration"] if t: - found = re.findall(r"[struct|enum|function|modifier] \(([\[\] ()a-zA-Z0-9\.,_]*)\)", t) + found = re.findall( + r"(?:struct|enum|function|modifier) \(([\[\] ()a-zA-Z0-9\.,_]*)\)", t + ) assert len(found) <= 1 if found: value = value + "(" + found[0] + ")"