HP 3000 Manuals

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


HP EDIT Reference Manual

Define Replace Pattern 

Purpose 

Enables you to define a replacement pattern for subsequent search and
replace commands.

Default Syntax 

=

Description 

This command enables you to define a replacement pattern so that you can
execute subsequent search and replace commands.  You can specify a
replacement pattern consisting of a string up to 80 characters in length.
[REV BEG]You can also specify an empty replacement pattern.  Using an
empty replacement pattern has the same affect as deleting something.[REV
END] Before you can execute search and replace commands, you must define
a search pattern as well as a replacement pattern.  Refer to the Define
Search Pattern command for complete information about defining search
patterns. 

When you execute the command, HP EDIT prompts you for the replacement
pattern.  You would then type the desired replacement pattern.  The
replacement pattern remains until you execute the command again and type
another replacement pattern.  After specifying the search pattern, you
can execute one of the available search and replace commands.

When you execute the command again, HP EDIT displays the current
replacement pattern on the message line.  If you press the Return key
without specifying another replacement pattern, HP EDIT retains the
current replacement pattern.

Procedure 

To define a replacement pattern: 

   1.  Press the = key, or press the Search/Replace function key,
       followed by the Define Replace function key.  HP EDIT displays
       Replace with ( ) :  on the message line.

   2.  Type the replacement pattern.

   3.  Press the Return key.  HP EDIT retains the prompt and typed
       replacement pattern on the message line and returning the cursor
       to its position prior to command execution.  The replacement
       pattern is now stored for subsequent search and replace commands.
[REV BEG]

To define an empty replacement pattern: 

   1.  Press the = key, or press the Search/Replace function key followed
       by the Define Replace function key.  HP EDIT displays Replace with 
       ( ) :  on the message line.

   2.  Type the empty replacement pattern "".

   3.  Press the Return key.  HP EDIT retains the prompt and the empty
       replacement pattern is placed within the parentheses.  The
       replacement pattern is now stored for subsequent search and
       replace commands.
[REV END]

Examples 

To define a replacement pattern consisting of the word EQUATE: 

   1.  Press the = key.  HP EDIT displays the following prompt on the
       message line:

            Replace with () : _

   2.  Type the word equate at the cursor position.  HP EDIT displays the
       prompt and typed text on the message line:

            Replace with () : equate_

   3.  Press the Return key.

Related Commands 

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



MPE/iX 5.0 Documentation