{"id":228,"date":"2019-05-30T01:25:20","date_gmt":"2019-05-30T01:25:20","guid":{"rendered":"http:\/\/edcint.co.nz\/checkwmiplus\/?post_type=faq&#038;p=228"},"modified":"2019-05-30T01:25:20","modified_gmt":"2019-05-30T01:25:20","slug":"regular-expression","status":"publish","type":"faq","link":"https:\/\/edcint.co.nz\/checkwmiplus\/faq\/regular-expression\/","title":{"rendered":"Regular Expression"},"content":{"rendered":"<p>Check WMI Plus uses regular expressions for many of its arguments\/parameters. These are very powerful &#8220;search strings&#8221;. If the &#8211;help output says that an argument uses regular expressions then you have a very powerful tool for finding exactly what you want.<\/p>\n<p>Check WMI Plus uses <a href=\"http:\/\/perldoc.perl.org\/perlre.html\" target=\"_blank\" rel=\"noopener noreferrer\">Perl Regular Expressions<\/a>.<\/p>\n<p>Regular expressions can be used to search for one very precise item and even multiple very precise items in a single definition.<\/p>\n<p>Common\/Basic regular expression characters:<\/p>\n<table>\n<tbody>\n<tr>\n<td>.<\/td>\n<td>Any character<\/td>\n<\/tr>\n<tr>\n<td>*<\/td>\n<td>None or more characters<\/td>\n<\/tr>\n<tr>\n<td>+<\/td>\n<td>One or more characters<\/td>\n<\/tr>\n<tr>\n<td>|<\/td>\n<td>Used for OR<\/td>\n<\/tr>\n<tr>\n<td>[]<\/td>\n<td>Used for a group of characters<\/td>\n<\/tr>\n<tr>\n<td>^<\/td>\n<td>Used to mark the start of a string<\/td>\n<\/tr>\n<tr>\n<td>^<\/td>\n<td>Used to mark the end of a string<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>There are many more regular expression characters available, read about them all <a href=\"http:\/\/perldoc.perl.org\/perlre.html\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>Below are some examples:<br \/>\n<code>check_wmi_plus.pl  -H win0 -u administrator -p parallel12 -m checkdrivesize --noishowusage -a REGEX<\/code><br \/>\nwhere REGEX is in the table below<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>REGEX<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>.<\/td>\n<td>Matches all drives, since . matches any single character, and all drives have at least one character<\/td>\n<\/tr>\n<tr>\n<td>^C<\/td>\n<td>Matches any drives starting with &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>Matches any drives containing &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C$<\/td>\n<td>Matches any drives ending in &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>Matches any drives containing &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C|D<\/td>\n<td>Matches any drives containing &#8220;C&#8221; or &#8220;D&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>Matches any drives containing &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C*<\/td>\n<td>Matches any drives containing no &#8220;C&#8221; or more<\/td>\n<\/tr>\n<tr>\n<td>C+<\/td>\n<td>Matches any drives containing at least one &#8220;C&#8221;<\/td>\n<\/tr>\n<tr>\n<td>C|D<\/td>\n<td>Matches any drives containing &#8220;C&#8221; or &#8220;D&#8221;<\/td>\n<\/tr>\n<tr>\n<td>[CD]<\/td>\n<td>Matches any drives containing &#8220;C&#8221; or &#8220;D&#8221;. 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<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"author":1,"template":"","faq_groups":[10],"class_list":["post-228","faq","type-faq","status-publish","hentry","faq-group-examples"],"_links":{"self":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/faqs\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/faqs"}],"about":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"faq-group","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/faq_groups?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}