Previous Topic: Mask SyntaxNext Topic: How Targets of an Operator are Processed


Sample Mask

The following pattern allows precise filtering of the output of the DIR command in the Windows command shell:

([0-9]{2}/){2}[0-9]{2} *[0-9]{2}:[0-9]{2}(a|p) *[0-9,]+ [_~0-9a-zA-Z ]*(\.[_0-9a-zA-Z ]*)?

The following lines match this pattern:

10/26/05 07:03p 134,217,723 pagefile.sys

10/26/05 07:03p 1,024 testfile

The preceding lines are made up of the following elements:

The pattern in a mask may differ depending on the exact characters to be matched. For example, [\._~0-9a-zA-Z ]* instead of [_~0-9a-zA-Z]*(\.[_~0-9a-zA-Z]*)? could also match the file names in our example outputs, but without imposing any restraints on the number of periods (.) in the file name.