PREV UP NEXT ne's manual

4.5.6: RepeatLast

(with replace we mean here a single replace, even if the last Replace operation ended with a global substitution).

This command is mainly useful for researching a given number of times, or replacing something a given number of times. The standard technique for accomplishing this is:

  1. Find (or FindRegExp) the string you are interested in;
  2. if you want to repeat a replace operation, ReplaceOnce with the replacement string you are interested in;
  3. now issue a RepeatLast n-1 command, where n is the number of occurrences you wanted to skip over, or replace.

The important thing about this sequence of actions is that it will work this way even in a macro. The Replace command cannot be used in a macro unless you really want to interact with ne during the macro execution. This is the only reason why the commands ReplaceAll and ReplaceOnce are provided.


Contact:
vigna@dsi.unimi.it - about ne
bela@www.emerson.emory.edu - about these pages