Regular Expression
Check WMI Plus uses regular expressions for many of its arguments/parameters. These are very powerful “search strings”. If the –help output says that an argument uses regular expressions then you have a very powerful tool for finding exactly what you want.
Check WMI Plus uses Perl Regular Expressions.
Regular expressions can be used to search for one very precise item and even multiple very precise items in a single definition.
Common/Basic regular expression characters:
. | Any character |
* | None or more characters |
+ | One or more characters |
| | Used for OR |
[] | Used for a group of characters |
^ | Used to mark the start of a string |
^ | Used to mark the end of a string |
There are many more regular expression characters available, read about them all here.
Below are some examples:
check_wmi_plus.pl -H win0 -u administrator -p parallel12 -m checkdrivesize --noishowusage -a REGEX
where REGEX is in the table below
REGEX | Description |
. | Matches all drives, since . matches any single character, and all drives have at least one character |
^C | Matches any drives starting with “C” |
C | Matches any drives containing “C” |
C$ | Matches any drives ending in “C” |
C | Matches any drives containing “C” |
C|D | Matches any drives containing “C” or “D” |
C | Matches any drives containing “C” |
C* | Matches any drives containing no “C” or more |
C+ | Matches any drives containing at least one “C” |
C|D | Matches any drives containing “C” or “D” |
[CD] | Matches any drives containing “C” or “D”. This seems similar to above, and it is, but it can be used in the place of a single character eg DATA[123] would match DATA1 or DATA2 or DATA3 |