-
Notifications
You must be signed in to change notification settings - Fork 28
Patterns
Patterns are used to specify files and folders to include or exclude from a watch path. By using the filters element along with the patterns, you can specify which files to include in the watch. Using patterns with the exclusion element, you can exclude files from a watch.
The patterns is not a specific element within the configuration file. You specify patterns to control how FileWatcher will work with files and folders that are changed. There are four patterns that can be specified:
Pattern | Description |
---|---|
Exact | Specify the exact file or folder. |
Contains | The file or folder contains a string value. |
File Mask | Using the traditional file mask specification, such as *.txt. |
Regular Expression | Using a regular expression to provided more granular matching. |
A file mask is used to on command line to search for multiple files of the same time, or similar names. In terms of pattern matching, it performs the same function.
You can use different file masks to match a specific pattern. To lookup valid files masks, look for DOS file masks.
All files:
*.*
All files ending with a .doc
extension:
*.doc
All files that have test
in the name:
test.*
Regular expressions allow you to search for string values using a series of special characters. A regular expression pattern can be simple or complex, but provides tremendous control over searching for strings within other strings.
For FileWatcher, you can create and test regular expressions at the Regex Storm .Net site.