home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
ME22-OS2.ZIP
/
MEHELP.ZIP
/
MEHELP.10
< prev
next >
Wrap
Text File
|
1980-01-01
|
2KB
|
49 lines
SEARCH AND SUBSTITUTION COMMANDS
<+SEARCH> (the F5 key) searches from the cursor position forwards for
the specified pattern.
<-SEARCH> (SHIFT F5 key) searches backwards from the cursor position
for the specified pattern.
For the two commands above, you are allowed to put any regular
expression as a pattern.
Regular expressions consist of the following metacharacters :
^ matches the beginning of a line
$ matches the end of a line
? matches any character
* matches 0 or more occurences of the previous pattern
+ matches 1 or more occurences of the previous pattern
[] character class
a|b matches pattern a or pattern b
\(a\) tags pattern a
\n refers to tagged pattern n. N is a digit from 1 to 9.
When you invoke these commands, you will be given the previous pattern
you typed in as a default. If you press <RETURN>, that pattern will be
used again. (If the previous pattern shown to you ends with a '!', it
means that you wanted to ignore the case.)
<TOGGLE CASE> (the ALT F5 key) toggles case sensitivity for searching.
<+SUBST> (F6 key) searches from the cursor position forwards for the
specified pattern, and for each occurence of the pattern, substitutes
the replacement string.
<-SUBST> (SHIFT F6 key) searches backwards from the cursor position,
then substitutes the replacement string.
The replacement string can have the metacharacter '&', which means
to substitute the matched pattern as part of the replacement. For
instance, if your pattern to search for was 'cat', and the replacement
string is 'alley&', then the word 'alleycat' will be replaced for each
occurence of 'cat'.
In the substitution text, you may also refer to a tagged pattern.
For example, let's say that the pattern that you searched for was :
\(dog\) = \(cat\)
If you want to replace every occurence of "dog = cat" by "cat = dog",
then the substitution pattern that you specify can be :
\2 = \1
You are asked if you want to approve each substitution. If you
reply 'n', then the replacements will be made globally from the cursor
position to the end (or beginning) of the file. If you reply 'y', then
when the pattern is found you are asked if you want to replace it,
ignore it, or stop the substitution operation totally.