Pattern matching is implemented through regular expressions just as JavaScript recognizes them. Discussion of regular expressions is outside the scope of this guide, because regular expressions are a language unto themselves. See the resource on the internet called WebReference.com:
http://www.webreference.com/js/column5/
Strings and numbers usually represent themselves. Some characters have special meaning and are meta characters. To use these characters in a literal sense, escape them with a backslash (\).
Table 14. Character Examples
Character | Explanation |
---|---|
0–9a–zA–Z | The character |
. | A character other than a new line |
* | Zero or more occurrences of the previous item |
+ | One or more occurrences of the previous item |
? | Zero or one occurrence of the previous item |
\f | Form feed or new page |
\n | New line |
\r | Carriage return |
\t | Tab |
\/ | / |
\\ | \ |
\. | . |
\Xnn | An ASCII character specified by the hex nn |
\w | A word character (a–zA–a0–9) |
\W | A non-word character |
\s | A white space character |
\S | A non-white space character |
\d | A digit 0–9 |
$ | End of string (In this case, as the last character in an event handler) |
^ | Match start of string (In this case, the first character in an event handler) |
| | Or = any of an alternate set |
(…) | A grouping |
Table 15. Pattern Examples
Pattern | Explanation |
---|---|
if|else | Match if or else |
m.*(Parent|Name) | Match m followed by one or more characters and Parent or m followed by one or more characters and Name |
Active.*Name | Match anything that contains the string Active, followed by one or more characters followed by Name |
.*\} | Match a string that contains zero or more characters before a closing brace (}) (A brace is a special meta character in regular expressions, and it must be escaped with a backslash (\)) |
.+\} | Match a string that contains one or more characters before a closing brace (}) |
\{\r\n | Match a line that contains a brace ({) followed by a carriage return and a line feed |
e\r\n|e$ | Match a line that ends in an e or an event handler that ends in an e |
\r\nf|^f | Match a line break that is followed by an f, or an event handler that starts with f |
Dashboard Architect supports the Find and Replace utility for these symbols when pattern matching is not enabled.