Regular expressions
Regular expressions provide a way to search for a general pattern of text rather than a specific piece of text. For example, you can use a regular expression to search for license plates that are based on a partial sighting.
A regular expression is written as a sequence of characters. The syntax combines the text for which you are searching with special characters to define the pattern.
Note:
Unlike a simple search,
a regular expression search is case-sensitive.
Character | Description |
---|---|
. | Matches a single character. For example, ABC
123. matches ABC 1234 and ABC 1235. Note: This character is equivalent
to the '?' character when you are searching for files by name in Windows
Explorer. |
^ | Matches the start of a line. For example, ^ABC matches ABC 1234 and ABC 2345 but not 1234 ABC. |
$ | Matches the end of a line. For example, 1234$ matches ABC 1234 and CBA 1234 but not 1234 ABC. |
* | Matches zero, one or more repeats of the previous character. For example xx* matches xx, xxxxxxx |
[] | Matches any character inside the brackets. You can specify a range of characters, for example [0-9], [a-z]. |
[^] | Matches any characters except the characters in the list. For example: [^ABC] matches any character other than "A", "B", or "C". |
| | Matches either the expression before the bar OR the expression after the bar. For example 1234$|1235$ matches any license plates that end in 1234 or 1235. |
\ | Ignores the special meaning of the next character. For example, abc$|def$|\|$matches any text that ends in abc, def or |. |
Analyst's Notebook does not support extended regular expression combinations (), \(\), \>, \<, \{, \}, and \digit.