Skip to content

Commit

Permalink
fix: Incorrect syntax on regexp end
Browse files Browse the repository at this point in the history
Fox example:
```yara
cuckoo.sync.mutex(/test\\/)
```
The last `/` was not detected as a end of string, because we only look
at the preceding character is not escaping the end of regexp. But what
if there is a another escape.
  • Loading branch information
MatejKastak committed Sep 6, 2023
1 parent c29d63f commit f3ca662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editors/vscode/language/yara.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"regexp-strings": {
"name": "string.regexp.yara",
"begin": "(?<!/)(/)(?!/|\\n)",
"end": "(?<!\\\\)(/)(i?s?)|((?:\\\\/)?[^/]*\\n)",
"end": "(?<![^\\\\]\\\\)(/)(i?s?)|((?:\\\\/)?[^/]*\\n)",
"beginCaptures": {
"1": {"name": "punctuation.definition.regexp.begin.yara"}
},
Expand Down

0 comments on commit f3ca662

Please sign in to comment.