File Director

Home 

Windows file sync exclusions syntax

The following is the Backus–Naur Form (BNF) definition of the syntax used for Windows File Sync Exclusions expressions.  

Quoted strings, such assize, are case insensitive in the implementation.
<alpha_char> evaluates to the characters a to z both upper and lower case.
<regular_expression> is a regular expression in the standard form.

<expression> ::= <exp>

 

<exp> ::= "size" <comparator> <bytes>

| "age" <comparator> <days>

| "path" <boolean_comparator> <regex>

| "name" <boolean_comparator> <regex>

| "ext" <in_set_operators> <string_list>

| "type" <boolean_comparator> <dir_type>

| <exp> <logical_operator> <exp>

| "insync"

| "not" <exp>

| "(" <exp> ")"

| "true" | "false"

 

<comparator> ::= ">" | "<" | "!=" | "==" | ">=" | "<="

<boolean_comparator> ::= "!=" | "=="

<in_set_operators> ::= "in" | "notin"

<logical_operator> ::= "and" | "&&" | "or" | "||"

 

<bytes> ::= <digits> <byte_units>

<byte_units> ::= "Mb"

 

<days> ::= <digits> <day_units>

<day_units> ::= "D" | "M" | "Y"

 

<dir_type> ::= "file" | "dir"

 

<string_list> ::= "[" <string> <strings> "]"

<strings> ::= "" | <string> <strings>

 

<regex> ::= "/" <regular_expression> "/"

 

<digits> ::= <digit> <digit_list>

<digit_list> ::= <digit> <digit_list> | ""

<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

 

<string> ::= <string_char> <string_char_list>

<string_char_list> ::= <string_char> <string_char_list> | ""

<string_char> ::= <digit> | <alpha_char>

Related topics


Was this article useful?