Regular Expressions in Track-It! E-Mail Monitor Policies
Parts of this document were taken from original Article ID: TIA03556
Found In: Track-It! 8.0, 9.0, 10.0, 10.5 Email Monitor
- Regular expression examples are shown below. There is also information in the help documentation on email policies and a quick search on Google will generate many websites devoted to regular expression syntax. A regular expression is a text string that is used to match a pattern of text, according to syntax rules. You can create matches by entering .NET regular expressions to represent any text that might be in an incoming e-mail sent to any of your Help Desk e-mail addresses.
- The following examples show how to use Regular Expressions to search for a single word, a single occurance of one of a list of words and the occurance of all specified words in an e-mail subject from a user:
- Single word (StringValue) - This simple example will match an e-mail with a single word anywhere in the subject and is not case sensitive.
A Regular Expression rule for matching a subject containing the word printer is shown below:
Entering just the word printer will match e-mails with the following subjects:
"User needs a new printer"
"My printer needs more ink"
"Can you tell me why my PRINTER won't work?"
- Multiple words (StringValue1|StringValue2|StringValue3) - OR - This example will match an e-mail where any one of the words specified is found in the subject. The pipe delimiter | acts as an OR condition in this case. This format will match an e-mail with StringValue1, StringValue2, OR StringValue3 anywhere in the subject and is not case sensitive.
A Regular Expression rule for matching a subject containing one of the words Printer|Desktop|Laptop as shown below:
Entering this phrase Printer|Desktop|Laptop will match e-mails with the following subjects:
User needs a new laptop
My printer needs more ink
Can you tell me why my desktop won't work?
- Multiple words (^(?=.*?\bStringValue1\b)(?=.*?\bStringValue2\b)(?=.*?\bStringValue3\b).*$) - AND - This example will match an e-mail where ALL of the words specified are found within the subject. The syntax above acts as an OR condition and will match an e-mail with StringValue1, StringValue2, AND StringValue3 anywhere in the subject and is not case sensitive.
Entering this phrase for example ^(?=.*?\bres\b)(?=.*?\bnew\b)(?=.*?\bhire\b).*$ will match e-mails with the following subjects:
"RES: John Smith new hire"
"RES: New employee John Smith - hire process start"