Closed gaohang closed 6 months ago
Can you provide some example of a rule, input file and results you are expecting?
rule $re = /ab.{,4}/ match result: abc ab. ab.c ab.cd desired result: the longest match, like ab.cd
With a pattern like /ab.{,4}/
YARA will return the longest possible match at every possible file offset where the pattern matches. For instance, if the file content is ababab
, you will get:
0x0:$a: ababab
0x2:$a: abab
0x4:$a: ab
This behaviour is by design, YARA will always report all the file offsets where the pattern matches, even if these matches overlap.
just like https://github.com/VirusTotal/yara/issues/504
when I use regex rule in yara, it match the same line multiple times. How to avoid it or is there any usage for this condition?