Skip to content

Filter with Regular Expressions

Use RegEx in a Table filter when wildcards (for example *sql*) are not precise enough, such as when you need to:

  • Match a specific pattern, like names following a naming convention.
  • Match case-insensitively.
  • Filter on a long list of values. Instead of selecting each value one by one, a single expression such as regex(server01|server02|server03) is a shortcut.

You can use Regular Expressions in Tables, in either of two filters.

  1. Open a Table and open the Advanced filter.
  2. Add a filter and select the field, for example Name.
  3. Set the first operator to is, and the second operator to matching regex.
  4. Enter your expression in the value field.

If the expression is not valid, the field is highlighted in red with the message The entered value is not in the correct format.

  1. Open a Table and expand the field you want to filter on in the Quick filter, for example DisplayName.
  2. Type regex( followed by your expression and a closing ), for example regex(sql.*).
  3. Click Match to apply the filter.

While you type, the list may show No values match your search. This is expected, since the expression is not a literal value. Click Match to apply it anyway.

Example: find SQL servers, excluding Express

Section titled “Example: find SQL servers, excluding Express”

To display all virtual hosts with virtual machines (VMs) running software with a name starting with “sql-”, but exclude those where the name includes the word “express” (useful when calculating Microsoft SQL license requirements):

  1. Create a Table displaying virtual hosts.
  2. Filter on Guest Database Software using one of the methods above:
    • Advanced filter: select matching regex and enter (?sui).*sql(?!.*express).*
    • Quick filter: enter regex((?sui).*sql(?!.*express).*) and click Match

The result is a list of all VMware hosts running VMs with a version of SQL, excluding those identified as “Express” versions.

The pattern used in the example:

PartMeaning
(?sui)Case-insensitive matching
.*Any sequence of characters
sqlThe literal characters “sql”
(?!.*express)Negative lookahead: “express” must not appear after this point

For the full syntax, see the Perl regular expressions reference and the Perl regular expressions tutorial.