You can test regular expressions using the Expressions pane
, located in the Configuration Dialog. To test regular expressions, follow the instructions below:
- 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 following options in the File menu on the Expressions pane to import text from an existing project document source file:
- Import file—Imports text from a project document source file for a text-based type, such as a Microsoft Word document, and converts the file to a temporary intermediate file for testing.
In order to test your regular expressions for a type that does not support text-based documents, such as LabVIEW or TestStand, you will need to save a copy of the intermediate file used by the type. To create a copy of the intermediate file on disk, enable the Intermediate file option for your document in the Project pane of the Configuration Window. With this option selected, Requirements Gateway will place the intermediate file in a folder called
intermediate when you analyze the project. This folder is located in the current project directory. You can then use the Import intermediate file option in the Expressions pane to import the text for testing:
Note: with the intermediate file option selected, modifying the source file will have no effect on the analysis, since Requirements Gateway will not overwrite an existing intermediate file. After modifying a source file, you must either deselect the Intermediate file option or delete the intermediate file on disk.
- Import directory—Imports text from multiple project document source files located in the same directory and converts all the files to a single temporary intermediate file for testing.
- Import intermediate file—Imports text from an existing intermediate file for testing.
- Enter a regular expression in the Regular expression control and, if necessary, a sub-regular expression in the Sub expression control.
- Click the Test regular expression button. If there are matches to the expression, they will be displayed in a table.
The Expressions pane also displays the values for any groups you have specified in the regular expression using parenthases. The Text field displays the text of the line containing the match, as shown in the image below: