A regular expression is a set of symbols or functions that allows complex pattern matching. You can use regular expressions in the Object Filters you specify for managed groups and for external applications.
More information on regular expressions can be found at the Microsoft website (www.microsoft.com). Search for the term regular expression.
Note: The following examples assume you have the Case Sensitive comparison option selected when creating filter conditions.
Regular Expression | Meaning | Example |
. | Matches any single character. | ^abc.$
|
* | Matches 0 or more of the preceding character. | ^abc*$ Matches ab, abc, and abccccc. |
+ | Matches 1 or more of preceding character. | abc+$ Matches strings ending with abc or abccccc. |
? | Matches 0 or 1 of the preceding character. | ^abc?$ Matches abc or ab only. |
[ ] | Matches any of the enclosed character set. | [acxz]$ Matches only strings ending in a, c, x, or z. |
^ | When specified as the first character in a regular expression, matches the beginning of a string. | ^[a-zA-Z0-9]
|
[^ ] | Matches any string not containing any of the enclosed characters. | [^XYZ] Matches only strings that do not contain X, Y, or Z. |
$ | When specified as the last character in a regular expression, matches the end of a string. | acxz$ Matches only strings ending in acxz. |
xyz | Matches any string containing this sequence. | abc Matches abc, zabcd, and wwabc. |
^ and $ | Matches an exact string. | ^abc$ Matches only abc. |
\d | Matches any digit character. Equivalent to [0-9]. | - |
\D | Matches any nondigit character. Equivalent to [^0-9]. | - |
\n | Matches a newline character. | - |
\w | Matches any word character including underscores. Equivalent to [A-Za-z0-9_]. | - |
Additional Examples
Example | Meaning |
A..bc | Find an A, followed by any two single characters, followed by a b, and then a c. This sequence can appear anywhere in the string. |
[A-E][v-z]dot | Find an uppercase letter in the range from A to E, followed by a lowercase letter in the range of v to z, followed by the letters dot. This sequence can appear anywhere in the string. |
[^ABC]1 | Find a string not containing A, B, or C, followed by a 1. Such a sequence can appear anywhere in the string. |
2\d\d | Find a 2 followed by exactly two digits. This sequence can appear anywhere in the string. |
\w*\.\w*$ | Find zero or more word characters, followed by a dot character, and then followed by zero or more word characters at the end of the string. |