Test Regular Expressions

Because the syntax of regular expressions can be complex, Service Design Center provides a helpful link to test the regular expressions you develop and add to the filters.

  1. Enter one or more regular expressions.
  2. Click RegEx Tester. A new tab or window opens and loads the regex101.com website with your regular expression(s) already loaded and the "g" and "m" modifiers (see below) already added.
  3. Enter one or more characters into the Test String box.

The Match Information box will either explain the match or tell you that the string you entered is not a match.

You can click RegEx Tester without first entering a regular expression. This will open the regex101.com website without pre-loading a regular expression to test, but with the "g" and "m" modifiers.

However, the connection is not two-way. If you enter a regular expression into the tester at regex101.com, it will not automatically get transferred to the filter field in Service Design Center. Once you successfully test a regular expression, copy it from regex101.com and paste it into Service Design Cetner.

More About Regular Expressions in the ItsOn Software Platform

The regular expression language has different "flavors," not unlike dialects in a spoken language. The ItsOn software platform uses the Java "flavor."

The differences between "flavors" are usually minor and esoteric and should not affect most of the regular expressions you will write for use in filters. The testing application at regex101.com offers several "flavors" of regular expressions to test against. You should use use the default, pcre (Perl compatible regular expressions), which is as close to a "standard" as there is for the regular expression language.

Modifiers at regex101.com

The regex101.com testing engine allows you to add several modifiers to its testing process. The access to the site from within Service Design Center selects two useful ones by default: "g" and "m."

The "g" modifier makes the test look for all matches instead of just the first one in a test string.

The "m" modifier allows the "^" and "$" anchors to match the beginning and end of lines, not just the beginning and end of the entire test string of characters, which allows you to enter and test multiple lines of text. For example, this is useful to test multiple phone numbers at once.