Export (0) Print
Expand All

Appointment.getRegExMatches method (JavaScript API for Office)

apps for Office

Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file.

Last modified: March 03, 2015


App type: Mail

Available in requirement sets


Last changed in Mailbox


Applicable Outlook modes


See all support details

var matches = Office.context.mailbox.item.getRegExMatches();

An array that contains the strings that match the regular expressions defined in the manifest XML file.

The getRegExMatches method returns the strings that match the regular expressions defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties.

If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results.

The following example shows how to access the array of matches for the regular expression regex1, which is specified in the manifest. Note that the current item in Microsoft Outlook can be a Message object or an Appointment object, both of which are derived from the Item object.

/ The initialize function is required for all apps.
Office.initialize = function () {
    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    // Get an array of string matches from the regular expression regex1, as specified in the manifest.
    var matches = Office.context.mailbox.item.getRegExMatches().regex1;
    // Continue processing the matches for the regular expression.

A checkmark (√) in the following table indicates that this property is supported in the corresponding Outlook host application. An empty cell indicates that the Outlook host application doesn't support this property.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

Supported hosts, by platform

Office for Windows desktop

Office for Windows RT

Office Online
(in browser)

OWA for Devices

Office for Mac


√ (Read mode only)

Available in requirement sets


Minimum permission level


App types










© 2015 Microsoft