Simple patterns follow a more traditional UNIX command line approach of using command line switches to indicate the nature of the pattern match. When simple patterns are used, the result set unconditionally includes all core file metadata fields. They are described in more detail below.
Simple Pattern syntax
Where you see
[patterns] in the command syntax for the
trigger commands, we allow filename patterns that match according the
- We maintain an inclusion and an exclusion list. As the arguments are processed we’ll accumulate them in one or the other. By default they are accumulated into the inclusion list.
-Xcauses any subsequent items to be placed into the exclusion list
-Icauses any subsequent items to be placed into the inclusion list
--indicates the end of the set of patterns
-pindicates that the following pattern should use
pcreas the expression term. This is reset after generating the next term.
-Pindicates that the following pattern should use
ipcreas the expression term and perform a case insensitive match. This is reset after generating the next term.
- If neither
-Pwere used, the generated term will use
!followed by a space followed by a pattern will negate the sense of the pattern match generating a
Any elements in the inclusion list will match; they are composed together using an “anyof” term.
The inclusion list and exclusion lists are composed using the logic
anyof exclusion) AND (anyof inclusion).
Generates a file expression:
["match", "*.c", "wholename"]
1 2 3 4
["anyof", ["match", "*.js", "wholename"], ["match", "*.css", "wholename"] ]
An example of how the exclusion list syntax works:
-X '*.c' -I '*main*'
1 2 3 4
["allof", ["not", ["match", "*.c", "wholename"]], ["match", "*main*", "wholename"] ]