About strings and regular expressions in WhatsConfigured

WhatsConfigured commands make use of two specific types of values, strings and expressions.

Strings are used to represent literal text values; string values are sequences of characters delimited by double quotes, such as:

"Four score and seven years ago"

Escape sequences (used to define special characters within strings) may be any of the following:

Escape sequence

Represents

\0

Null character

\'

Single quote

\''

Double quote

\?

Literal question mark

\\

Backslash

\a

Bell alert (audible bell)

\b

Backspace

\f

Formfeed

\n

New line

\r

Carriage return

\t

Horizontal tab

\v

Vertical tab

Additionally, the \x escape sequence can be used to include arbitrary characters in strings, including unprintable and control characters. \x should be followed by one to four hexadecimal digits which specify the value of the desired character. For example,

"This is Control-S: \x13"

Regular expressions are used for matching patterns in the output of script commands. Regular expression values are .NET regular expression strings delimited by forward slashes. For example, the following regular expression might be used to match the command prompt on a particular device (i.e., one or more characters followed by > or #):

/.+(>|#)/

Because forward slashes are used to delimit regular expression values, including a forward slash as part of the regular expression itself, requires the use of the // escape sequence. For example, the following regular expression matches one or more characters followed by a forward slash followed by one or more characters followed by #:

/.+//.+#/

Note: All regular expression matching is case-insensitive.

See Also

Using WhatsConfigured Commands

About commands

About basic WhatsConfigured command syntax

About "$"

Storing WhatsConfigured command output in the WhatsUp Gold database

Editing WhatsConfigured command output

Using WhatsConfigured commands with queries

About WhatsConfigured command layout

WhatsConfigured script variables affecting command execution

About WhatsConfigured command types