CONTENTS | INDEX | PREV | NEXT
SYNTAX : RANGE R STRING 1 ESC STRING 2 ESC
: RANGE R ESC STRING 2 ESC
RESULTING ARGUMENT: Number of changes
FUNCTION : Replace a character string by another character string
as many times as possible within the range. After
execution, the cursor (and implicitly the value of . )
is positioned immediately after the last string replaced.
It is not necessary to position the cursor within the
range; it is automatically moved to the beginning of the
range before the search starts.
The first string immediately follows the command in the
command sequence, and is terminated by an ESC. The
second string immediately follows that ESC, and is in
turn terminated by another ESC.
No error-condition will ever result; the number of
matches (whether 0 or higher) is simply returned.
RANGE : START,END
START : the buffer position to start at
END : the buffer position to stop at
EXAMPLE : h r hello ESC world ESC =
Will replace the string hello by world as many times
possible, and show the number of replacements.
NOTE 1 : Search-behaviour is governed by the Search Mode setting
(see CTRL_X)
NOTE 2 : If the first string is empty (the terminating ESC
follows the command, as in h r ESC world ESC) then the
previous search string is reused.
NOTE 3 : The search string (used for both search and replace
commands) is accessable in register _ at all times.
NOTE 4 : The ESC character must not occur in either search- or
replacement string.
NOTE 5 : The RETURN character is allowed anywhere in the search-
or replacement string.
MATRIX