You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sigma/backends/golangexpr/golangexpr.py
+5-2
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,12 @@ class GolangExprBackend(TextQueryBackend):
47
47
field_quote_pattern_negation : ClassVar[bool] =True# Negate field_quote_pattern result. Field name is quoted if pattern doesn't matches if set to True (default).
48
48
49
49
### Escaping
50
-
field_escape : None#ClassVar[str] = "\\" # Character to escape particular parts defined in field_escape_pattern.
50
+
# CAUTION: the following could be considered as a slightly hacky solution
51
+
# but since expr does not allow any "special" chars in its field names
52
+
# absuing the escaping to add `?` to any `.` (https://expr-lang.org/docs/language-definition#optional-chaining) seems reasonable
53
+
field_escape : ClassVar[str] ="?"# Character to escape particular parts defined in field_escape_pattern.
51
54
field_escape_quote : ClassVar[bool] =True# Escape quote string defined in field_quote
52
-
field_escape_pattern : ClassVar[Pattern] =re.compile("\\s") # All matches of this pattern are prepended with the string contained in field_escape.
55
+
field_escape_pattern : ClassVar[Pattern] =re.compile(r"\.") # All matches of this pattern are prepended with the string contained in field_escape.
53
56
54
57
## Values
55
58
str_quote : ClassVar[str] ='"'# string quoting character (added as escaping character)
0 commit comments