Appointment.getRegExMatches method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

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

Last modified: November 24, 2014

Applicable Outlook modes


Available in requirement sets


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.

App types

Mail app

Supported clients

Outlook 2013, Outlook 2013 SP1, Outlook 2013 RT, Outlook Web App, OWA for Devices, Outlook for Mac





© 2014 Microsoft