Testing Regular Expressions

NI Requirements Gateway 2018 Help

Edition Date: March 2018

Part Number: 371714F-01

»View Product Info
Download Help (Windows Only)

Use the Expressions pane of the Configuration dialog box to test the regular expressions you define for custom types you create on the Types pane. Testing expressions can help you ensure that the expressions accurately capture the appropriate elements before you use the expressions in a project.

Complete the following steps to test a regular expression.

  1. On the Expressions pane, enter project document source file text to use for testing the expression in the Text analysis control. You can also use the options in the File menu to import source text from a source file, a directory of source files, or an existing intermediate file for a text-based type, such as a Microsoft Word document.
  2. Enter a regular expression in the Regular expression control and, if necessary, a sub-regular expression in the Sub expression control. You can also populate the expressions automatically by clicking Test regular expression next to the expression controls on the Analysis tab of the Types pane.
  3. Click Test.

    Requirements Gateway tests the expressions against the text you entered or imported in the Text analysis control. If the expression does not match anything in the imported text, Requirements Gateway displays the message Text doesn't contain any correspondence with the regular expression just below the regular expression controls.

    If the expression matches elements of the analyzed text, Requirements Gateway displays the results in the Results Table at the bottom of the Expressions pane.

Updating Tested Expressions

You can modify and retest the tested expressions in the Regular expression and Sub expression controls until you obtain the result you want.

If you clicked Test regular expression on the Types pane to launch the Expressions pane with the expression controls already populated, and then modified those expressions on the Types pane, click Update on the Expressions pane to replace the previous expressions you imported from the Types pane with the most recent versions. The Update button is available only when you click Test regular expressions on the Types pane.

WAS THIS ARTICLE HELPFUL?

Not Helpful