Selective-Display and Regular Expressions using D/3®Edit

PUBLISHED ON Jul 06, 2010

By John Hermann, Applications Engineer

Selective Display is a very useful feature in D/3Edit which allows the user to define which lines of text to display based on a search term, where all of the other text is collapsed (some other editors use the term folded).

Regular expressions are a standard search feature.  In addition to explicit searches, the user can also use special characters to improve the specificity of their search.

There are anchor characters (“^” and “$”) that can focus the search to what is at the beginning of a line or what is at the end of a line.

There are special wild characters
(:a, :b, :c, :d) that reference alphanumeric characters, whitespace, alphabetic characters, and decimal digits respectively.

Lastly there is the Or logic function “|”.  This allows the user to search for more than one item at a time.

Here are several examples of these search modifiers:

This is of a PCM CDB database.  To bring up the Selective Display, go to View -> Selective Display.

This is the selective-display window.  Notice that Search Text is the type of Selective-Display chosen.  Also, the Reset selective display and regular expression options are selected as well.

This is the result of the selective display search for the string “DEF”.  Notice that both the AI EPN (DEF AI  ____) definitions as well as the spare AI not defined are displayed (; AI xx not defined).  The spare AI lines are displayed because defined contains “DEF”.

This is the same search but the regular expression anchor “^” is used to define just the lines that begin with the string “DEF”, not any line that contains the string “DEF”.

This is the result of the regular expression search ^DEF

Regular expressions can also incorporate logic.  This search is for lines that begin with DEF (EPN definitions) or lines that begin with IPN: (which defines the IPN for a given EPN).

This is the result of the regular expression search “^DEF|^IPN:”

This is the search for lines that begin with “DEF” or lines that begin with “;”. This search allows for the easy selection of whole EPN definitions, taking advantage of the fact that often EPN definitions in a CDB .mdl file are separated by a single line containing a semi-colon.

The result of the selective display search “^DEF|^;”.  Notice that the EPN definition for DEV0NGUNL is selected.

The command view -> Show All displays the text normally.

Notice that after the Show all command is issued, the entire EPN definition for DEVONGUNL is selected.

This is a SA program using the standard SC/SA structure.

This selective display search looks for any line that begins with a alphanumeric character (which will be a label) or any line that contains GOTO.

As can be seen, all of the Program labels are displayed (MAIN:, ST1:, ST1SS:, ect) as well as all of the GOTO calls.  On this one screen, all of the state transitions are summarized – assuming that no transitions are made in any subroutines.

This regular expression adds in any line that contains IF, BEGIN, END.  This search will display more information.

This screen shot shows a little more detail on the conditions for state transitions.