HP 3000 Manuals

Define Replace Pattern From Text [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation


HP EDIT Reference Manual

Define Replace Pattern From Text 

Purpose 

Defines a pattern from text for subsequent search and replace commands.

Default Syntax 

None

This command does not have a default key assignment.  You can either
assign a key to the command using the Assign Key command or issue the
command using Execute Editor Command.

Description 

This command functions similarly to the Define Replace Pattern command,
except that rather than responding to a prompt, you use the current line
of text to define the replacement pattern.

There are two applications for this command:

   *   Using a line of text as the replacement pattern

   *   Editing the current replacement pattern

To use a line of text as the replacement pattern, you would create the
line of text as the replacement pattern and then execute the command.
You could alternatively move the cursor to an existing line, edit it if
desired, then execute the command.

To edit the current replacement pattern, you would first insert the
current pattern into text using the Insert Replace Pattern command.  Then
you would edit the replacement pattern and execute the Define Replace
Pattern From Text command.

This application is useful when you have created a replacement pattern
using the Define Replace Pattern command and want to edit it rather than
create a completely new replacement pattern.

Procedure 

To define a replacement pattern from text: 

   1.  Move the cursor to the line of text that you want to use as the
       replacement pattern [REV BEG]or select a character block.[REV END]

   2.  Issue Execute Editor Command (E). HP EDIT displays Command:  on
       the message line.

   3.  Type define replace pattern from text beginning at the cursor
       position.

   4.  Press Return.  HP EDIT displays Replace pattern defined on the
       message line.  The replacement pattern is now stored for
       subsequent search and replace commands.

       You can check the replacement pattern contents by executing the
       Define Replace Pattern (=) command.  HP EDIT displays the current
       replacement pattern on the message line.  Press Return to preserve
       the current replacement pattern.

Example 

To edit the current replacement pattern of INTEGR: 

   1.  Issue Execute Editor Command (E). HP EDIT displays the following
       prompt on the message line:

            Command: _

   2.  Type insert replace pattern beginning at the cursor position and
       press Return.  HP EDIT inserts integr above the current line.

   3.  Insert the letter e after the letter g using the Insert Character
       (i) command.

   4.  Press / and Return to return to Command mode.

   5.  Issue Execute Editor Command (E). HP EDIT displays the following
       prompt on the message line:

            Command: _

   6.  Type define replace pattern from text beginning at the cursor
       position and press Return.  HP EDIT displays the following
       message:

            Replace pattern defined: integer

       The replacement pattern integer is now stored for subsequent
       search and replace commands.

Related Commands 

       Define Replace Pattern
       Define Search Pattern
       Define Search Pattern From Text
       Global Search And Replace Backward
       Global Search And Replace Forward
       Insert Search Pattern
       Search And Replace Backward
       Search And Replace Forward
       Search Backward
       Search Forward



MPE/iX 5.0 Documentation