The r command replaces the current line, replaces a string of characters within the current line, or replaces a string of characters within a specific range of lines.
|Indicates universal replace.
|Specifies the number of lines to be replaced.
|(forward-slash) Delimiter that can be any nonnumeric character.
|If null, a new string is inserted at the beginning of the line.
|If null, and the old string is found, the old string is deleted from the line.
|Specifies the beginning column range in which strings are eligible for replacement.
|Specifies the ending column range in which strings are eligible for replacement.
Only the first occurrence of the old string is replaced with the new string. The ru form replaces all (universal) occurrences. If the number of lines is specified, the line pointer is incremented accordingly.
An r command, followed by pressing Enter, allows the replacement of an entire line. Pressing ENTER at the first position of the line returns control to the Editor command prompt and the line remains unchanged.
Multiple replacements may be performed on a line without filing the data with the f command.
The ^ represents an attribute mark in the Editor. Used with the r command, it has the effect of terminating the line. See the following .r/abc/^ example.
Positions cursor at the beginning of line nnn for replacement of the entire line. A subsequent Enter leaves the line intact.
r nnn _
Positions cursor at the beginning of each of the next ten lines for entire line replacement.
Replaces the first 3 characters (wildcards or ^) of the current line with null. That is, deletes the first three characters.
Replaces the first occurrence of the string, abc, with an attribute mark (^), terminating the line prior to the string, abc.
Places the string, abc, at the beginning of the next ten lines.
Replaces the first occurrence of the string, abc, with the string xyz in the current and the next nine lines.
Replaces all occurrences of the string, abc, with the string, xyz, in the current and next nine lines.
Replaces the first occurrence of the string, abc, with the string xyz in the current and next nine lines when the string is found in column positions 5 through 9.
Replaces all characters on the current attribute with null, leaving the current attribute intact, but empty.
Replaces every occurrence of two spaces with one space, from the current line through the end of the item.
ru999/ / /