Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Testing regular expressions

Updated on March 15, 2022

Test for potential security issues that custom code can introduce into your application. Use the Regular Expression tester to test whether a text pattern matches the regular expression.

  1. In the navigation panel of Dev Studio, click App.
  2. Use the Application Explorer to open the Code-Pega-Parse.RegExpTester standard activity.
  3. Click ActionsRun. The system displays a test input form.
  4. On the test input form, in the Page list, click Empty test page.
  5. Leave the parameter values blank.
  6. Click Run.
  7. Complete the following fields on the detail form:
    FieldEnter
    Regular ExpressionEnter a regular expression to use, using syntax conforming to the Java implementation of regular expressions (Java.util.regex.Pattern).
    SourceEnter source text to use to search for matches to the regular expression.
    UNIX LinesSelect this check box to recognize only newline characters (\n, also called line feed) as end-of-line delimiters. Clear to recognize additional characters or character pairs as end-of-line delimiters: carriage return (\r), carriage return followed by newline, next-line (\u0085), line-separator (\u2028) or paragraph-separator (\u2029).
    MultilinesSelect this check box to cause the ^ and $ expressions to match immediately after or immediately before a line terminator or the end of the input sequence respectively.

    Clear to have these expressions only match at the beginning and the end of the entire input sequence.

    Canonical EquivalenceSelect this check box to cause two characters to match if their full canonical decompositions match.

    For example, the expression a\u030A matches the string "?" when you select this flag. By default, matching does not take canonical equivalence into account.

    CommentsSelect this check box to ignore all white space (tabs and spaces) within the Source text, and to ignore all material starting with a # comment character through the end of the line.
    Dot Matches AllSelect this check box to indicate that a period character matches any character, including a line terminator. Clear to indicate that a period character matches any character except a line terminator.
    ASCII Case InsensitiveSelect this check box to match uppercase with lowercase ASCII characters.
    Unicode Case InsensitiveSelect this check box to match uppercase with lowercase ASCII characters.
  8. Click Test Expression.
Result: Pega Platform generates a table that lists the results of each match of regular expressions found in the source text.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us