Shared Email Templates
Extract data using a regular expression
With the RegexExtract macro in your template, you can automatically search the Outlook email message you’re replying to for text that matches a regular expression (regex), for example order IDs, extract the matched text, and insert it into your reply. Here’s how:
In the template you’re creating or editing, place the cursor where you want the extracted text to appear.
On the template editor toolbar, select the
Insert macro button.Select RegexExtract.
In the Regex extract dialog:
- Select the fields to be searched (message body, From, To, Cc, Bcc, Subject, recipient’s first, last, or full name, sender’s first, last, or full name).
- Enter a regex that matches the text you want to extract.
- If you want to make the search case insensitive, select the corresponding checkbox.
- To return all matches, keep the Extract all matches checkbox selected. To return only the first match, clear the checkbox.
- If returning multiple matches, enter a delimiter to separate them.
When you’re finished, select OK.

Save your template.
When you use the template, the selected fields are searched for text matching your regular expression. Depending on your settings, either all matches or only the first one are added to your email message.
