Choice of Programs

Regular expressions are not executed directly unless Tcl, the language in which Redet is written, is chosen as the regular expression engine. Instead, another program is called to execute the regular expression. This guarantees that the regular expression notation supported by the chosen program will be used. The program executed is selected via the Program menu.



Display with Program Menu Posted

The main search tools, editors, shells and programming languages with built-in regular expression support are included. Naturally, only those programs installed on the machine and found in the user's search path will be executed. If you are using redet to construct a regular expression for use with a particular program, naturally you will select the program that you intend to use. If, on the other hand, you are using redet as a search tool, you will find that some choices of program are much better than others. In general you should choose a program that supports all of the features that you wish to use, uses a familiar notation for them, and executes quickly. You will therefore want to avoid shells, since these execute slowly, and other large programs, such as emacs. A full-featured program specifically intended for searching, such as egrep, will generally be the best choice.

Redet has a built-in default program, which will be used in the absence of any action by the user to choose another program. The user may select another program at any time via the Program menu. An alternative initial program may be specified in the user's initialization file or on the command line. Specification of the program on the command line takes precedence over specification in the initialization file.

If the initial program (whether the default or specified in the init file or on the command line) is not available, tcl is selected. This guarantees that a useful regular expression environment will be available and ensures that various things dependent on there being a selected program will work properly.

When a new program is selected, the label of the menu button that causes execution of the regular expression is changed to indicate the selected program. Notice how the third menu button is now labeled Execute-Python instead of the Execute-Egrep, reflecting the fact that the program has been changed from the default of egrep to python.



Display Showing Changed Execute Button Label

Many regular expression searching programs consider a regular expression to match the entire input string or line if it matches anywhere in the string or line. In this case, we may think of the regular expression as implicitly surrounded by "match anything" wildcards. Failure to remember which programs behave which way is a common cause of errors. Redet therefore tests for this property and marks it on the program name in the Execute-... button. (Details are discussed below.)


Next

Back to Table of Contents