File Commander

Wildcard expressions


File Commander extends on the standard wildcard operators * and ? with the following list.

OperatorFunction
* Matches zero or more characters of any value.
? Matches one character of any value.
[a-d] Matches one character of value a, b, c or d.
[^a-d] Matches one character of any value except a, b, c or d.
[a-d^c] Matches a, b or d.
{fred,joe,foo} Matches any one of the comma separated strings.

In addition, several expressions can be combined using the following operators.

Operator Function
| The OR operator, give a match if either of the expressions given match. IE "*.cpp | *.h" will match all .CPP and all .H files, and is equivalent to "*.{cpp,h}".
& The AND operator, give a match if both expressions match. IE "*x* & *y*" will match any file name that contains both an X and a Y. The AND operator has higher priority than the OR operator, so "a* & *b | c* & *d" is equivalent to "(a* & *b) | (c* & *d)".
! The NOT operator, reverses the match / no match result of any expression. "!*x*" will match any file name that doesn't contain an X.

Also available are a number of operators that can be used to select files by criteria other than their names. These are used by writing an expression that consists of the file operator (listed below), a logical comparitor ( one of < > = != >= <= ) and a value. The value can have a single letter suffix to specify the units it's in.

%age Represents the amount of time between the file's last modification and the present. Value is in seconds by default or can be followed by a suffix to specify minutes, hours or days.
%attrib Represents the file's attributes. Use of the = operator actually means has the attribute. The != operator can also be used to mean doesn't have the attribute. The value can be any combination of the letters R,H,S,A,D.
%date Represents the file last modification date. The comparison value is a date in your local date format. The year may be given as either 2 or 4 digits. A year of less than 70 will be interpreted as 21st century.
%size Represents the file size. The comparison value is in bytes unless followed by a suffix kilobytes, megabytes or gigabytes.

Examples

*.bak & %age > 30d Match backup files that are older than 30 days.
*.{exe,cmd,bat,com} Match only executable files.
*.doc & %date >= 1/5/98 & %date <= 31/5/98 Match documents last modified in May 1998 (in date format used in Australia).
%attrib = RH Match files that are both read-only and hidden.

Return to File Commander Home Page