# replace-string(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

replace-string - Replace string with new string

## SYNOPSIS

n replace-string (esc r)

## DESCRIPTION

replace-string replaces all occurrences of one string with another string. The replacement starts at the current location of the cursor and goes to the end of the current buffer.

A numeric argument positive n limits the number of strings replaced to n. A negative argument n limits the number of lines in which the replacement may take place, e.g. a value of -15 restricts the replacement of the string to the next 15 lines from the current cursor position.

$result(5) is set to a list giving the number of substitutions, a replace mode of 'a' for all and the replace with string.

## SEE ALSO

See Operating Modes for a description of the magic(2m) and exact(2m) modes which change the search space.

buffer-mode(2), query-replace-string(2), search-forward(2), $result(5).
Regular Expressions

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>