Documentation forWeb Performance Monitor

Use regular expressions in the Web Transaction Recorder

When you create a recording in the Web Transaction Recorder, you can add a text validation step that searches for regular expressions instead of just single words. Also called "regex" or "regexp," you can use this functionality to search for specific strings, groupings, or phrases on web pages. If the match is not successful, WPM sets the transaction status to Down.

Some examples of regular expressions include:

  • ^Old version: Searches for "Old version" text that appears before other text.
  • Screenshot$: Searches for the word "screenshot" at the end of text.
  • te*box: Matches tbox, tebox, teebox, teeebox,, and so on.
  • te+xtbox: Matches textbox, teextbox, teeextbox, teee.......xtbox, and so on.
  • Pas{1,}: Matches, pas, pass, passs, pass, Passs...., and so on.

For example, use \w+.&.\w+ to search for text created from two words split by an ampersand (&) symbol, such as "Fish & Chips."

Note the following details about using regular expressions:

  • This feature is a subset of the Text Validation feature.
  • WPM searches all text on a page, except HTML tags.
  • Certificate Common Names (CNs) are not included in regex searches.
  • For best results, make Text Validation the first action on the page loaded after logging in.
  • The more text on a page, the longer time it takes to search the page. Playback may time out.

To learn more, see the Regular Expression Language Quick Reference (© 2020, Microsoft Corp., available at, obtained on April 24, 2020).

To use regular expressions in a recording:

  1. Click Add text validation .
  2. In the Add Text Match dialog box, type the text you want WPM to check for.
  3. Select the "Use regular expression" check box.

  4. Select a Verify text option, based on whether you want specified text to appear.
  5. Indicate the time WPM should wait for text to match.
  6. Click Add.