Use of regular expressions
You can use regular expressions in OQL and in stitcher language code. Regular expressions are particularly useful for defining filters.
^AL[.]*
searches
for all items beginning with AL. The filter condition EntityName
Like ^..N[.]*
filters for all devices which have an N as
the third letter of their name, and EntityName Like [.]*G
filters
for all devices whose name ends with the letter G. The following table
describes the most common characters used in regular expressions.
Character | Description | Example |
---|---|---|
|
The backslash (or escape character) quotes the character after it, both special and ordinary. |
Use the backslash to specify a |
|
The dot represents any single character. |
A dot can be anything. If you want to select
five letter device names that begin with T and end with R, you would
state, |
|
Like the dot, an asterisk can represent any character. However, whereas the dot can only represent a single character, the asterisk represents anywhere from zero to an infinite amount of characters. |
|
|
The dollar sign at the end of a regular expression signifies the end of a line, and, therefore, any character immediately before it must be located at the end of the string. Anywhere else in a regular expression, it matches itself. |
|
|
A hat (circumflex) at the beginning of a regular expression means that it is the beginning of a line, and any characters immediately following it must be located at the very beginning of the string. Anywhere else in a regular expression, it matches itself. |
|
|
A set of characters in square parentheses matches any single character from a set. |
|