Define Search Pattern From Text [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Define Search 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 Search Pattern command,
except that rather than specifying a search pattern in response to a
prompt, the current line of text defines the search pattern instead.
There are two applications for this command:
* Using a line of text as the search pattern
* Using a character block of text as the search pattern
* Editing the current search pattern
To use a line of text as the search pattern, you create a line of text as
the search pattern, then execute the command. You can alternatively move
the cursor to an existing line, edit it, then execute the command.
To edit the current search pattern, you first insert the current search
pattern into text using the Insert Search Pattern command. Then edit the
search pattern and execute the Define Search Pattern From Text command.
This application is useful when you have created a search pattern using
the Define Search Pattern command and want to edit it rather than create
a completely new search pattern.
Refer to the Define Search Pattern command for information about
available pattern-matching characters.
Procedure
To define a search pattern from text:
1. Move the cursor to the line of text that you want to use as the
search pattern.
2. Issue Execute Editor Command (E). HP EDIT displaying Command: on
the message line.
3. Type define search pattern from text beginning at the cursor
position.
4. Press Return. HP EDIT displays Search pattern defined on the
message line. The search pattern is now stored for subsequent
search commands.
You can check the search pattern contents by executing the Define
Search Pattern (f) command. HP EDIT displays the current search
pattern on the message line. Press Return to retain the current
search pattern.
[REV BEG]
To define a search pattern using character blocks:
1. Move the cursor to the point you want the search pattern to begin.
2. Press x, Mark Character Block Start.
3. Move the cursor to the character where you want the search pattern
to end.
4. Press f, Define Search Pattern. HP EDIT retains the selected
character block as the search pattern and stores it for subsequent
search commands.
[REV END]
Example
To edit the following search pattern consisting of seven capital letters
starting with TH:
TH[A-Z][A-Z][A-Z][A-Z][A-Z]
1. Issue Execute Editor Command (E). HP EDIT displays the following
prompt on the message line:
Command: _
2. Type insert search pattern beginning at the cursor position and
press Return. HP EDIT inserts the search pattern above the
current line.
3. Move the cursor to the letter H and delete it using the Delete
Character (d) command.
4. Issue Execute Editor Command (E). HP EDIT displays the following
prompt on the message line:
Command: _
5. Type define search pattern from text beginning at the cursor
position and press Return. HP EDIT displays the following
message:
Search pattern defined: T[A-Z][A-Z][A-Z][A-Z][A-Z]
The modified search pattern is now stored for subsequent search
commands.
Related Commands
Define Replace Pattern
Define Replace Pattern From Text
Define Search Pattern
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