Shared Email Templates for Microsoft Outlook

Add regular expressions to datasets

You can include regular expressions in a simple or an Excel-based dataset to find matching strings in the fields of received email messages and bring data from the corresponding dataset rows to your replies with the Insert or the WhatToEnter macro.

To get a quick Regexes cheat sheet, click the button below.

Download cheat sheet

Video: How to fetch table data with regexes and use them in Outlook emails

Discover how to easily pull data from datasets and automatically insert them into your Outlook emails using regular expressions.

How to add regexes to datasets

  1. Start editing a simple dataset that you want to supplement with regular expressions. Add a new column and select Regex field from the dropdown menu.
    The Regex field option
  2. Add one more column to your dataset and select Regex.
    The Regex option
  3. In the Regex field column, select a field where you want to look for matching strings: body, from, to, cc, bcc, subject, location, recipient's or sender's first, last, or full name. In the Regex column, enter your regular expression.
    A sample dataset containing regular expressions

Your dataset is ready, and you can use the data it contains in your outgoing email messages.

How to extract data from datasets with regexes

Suppose you often receive emails with some order IDs in the message body and those order IDs have an abbreviated country name as part of their structure, like this: "DE73491".
An abbreviated country name in an order ID

When replying to such an email, you'd like its message body to be checked for a specific abbreviation so that you can automatically include relevant information from your dataset in your reply. You'll need:

  • The Regex field column in your dataset with the body option selected
  • Regular expressions covering the structure of the order IDs in the Regex column, for example \bDE[0-9]{5}\b
  • The Insert macro (the Insert Dataset Value option) in your template to bring the necessary details from the dataset to your reply, for example the name of the country and the delivery period
    A sample template with the macro placeholders

When replying with such a template, you'll get the name of the necessary country and the delivery period automatically returned from your dataset and inserted into your email message.
Details returned from a sample dataset

Post a comment

Seen by everyone, do not publish license keys and sensitive personal info!

If you have any questions or issues with this add-in, please feel free to post your concerns in the comments area. As soon as we answer, a notification message will be sent to your e-mail. If you do not want to share your thoughts in public, please contact us at