Skip to content

Commit

Permalink
Empty string is not a valid regex
Browse files Browse the repository at this point in the history
  • Loading branch information
frack113 committed Nov 8, 2024
1 parent ad6f3c3 commit 7d1ac24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sigma/processing/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,11 @@ def __post_init__(self):

def apply_string_value(self, field: str, val: SigmaString) -> Optional[SigmaString]:
regex = ""

# empty string can not be convert into a simple regex
if val == "":
return val

for sc in val.s: # iterate over all SigmaString components (strings and special chars)
if isinstance(sc, str): # if component is a string
if (
Expand Down

0 comments on commit 7d1ac24

Please sign in to comment.