Rat Exclusion Expressions

Rat uses a variation on the Ant or Git exclusion syntax.

The table below shows an example of how the * and ** differ and interact.

foo/x/y b/foo b/foo/x a/b/foo foo a/b/foo/x/y a/b/foo/x foo/x b/foo/x/y
foo F F F F T F F F F
foo/* F F F F F F F T F
foo/** T F F F T F F T F
*/foo F T F F F F F F F
*/foo/* F F T F F F F F F
*/foo/** F T T F F F F F T
**/foo F T F T T F F F F
**/foo/* F F T F F F T T F
**/foo/** T T T T T T T T T

Inclusion/Exclusion Notes

Patterns that are excluded may be superseded by patterns that are included.

For example: the exclusion pattern ‘ca*’ used in conjunction with the include ‘cat’ would result in the file ‘cat’ being included but ‘can’, ‘call’ and the abbreviation for california (or Canada) ‘CA’ being excluded.

When processed a negated exclusion results in an inclusion, and a negated inclusion results in an exclusion.

Once a file is explicitly included it can not be excluded.

Directory separation characters

Patterns may use either ‘/’ or ‘\’ as the path separation character. ‘/’ is recommended.

Case sensitivity

The case sensitivity of the matching patterns depends upon the file system in use. If the file is case-sensitive then the matches are case-sensitive.