Regular expressions are one of the most powerful features of YARA. They are
defined in the same way as text patterns, but enclosed in forward slashes
instead of double-quotes, like in the Perl programming language.
Regular expressions can be also followed by nocase, ascii, wide,
and fullword modifiers just like text patterns. The semantics of these
modifiers are the same in both cases.
Additionally, they can be followed by the characters i and s just after the
closing slash, which is a very common convention for specifying that the regular
expression is case-insensitive and that the dot (.) can match new-line
characters. For example:
Notice that /foo/i is equivalent to /foo/ nocase, but we recommend the
latter when defining strings. The /foo/i syntax is useful when writing
case-insensitive regular expressions for the matches operator.
YARA’s regular expressions recognise the following metacharacters:
Character
Meaning
\
Quote the next metacharacter
^
Match the beginning of the data, or negates a character class when used as the first character after the opening bracket
$
Match the end of the data
.
Matches any single character except a newline character