# query-replace-string(2)

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

## NAME

query-replace-string - Search and replace a string - with query

## SYNOPSIS

query-replace-string (esc C-r)

## DESCRIPTION

query-replace-string operates like the replace-string(2) command. replacing one string with another. However, it allows you to step through each string and ask you if you wish to make the replacement. The user is prompted for a replacement response as follows:-

?

Help - get a list of options.

y or space

Make the replacement and continue on to the next string.

n

Do not make the replacement, and continue.

a or !

Replace the rest of the strings without asking.

e

Edit the replacement string.

l

Last replacement, do next and stop.

u

Undo last replacement.

^G

Stop the command.

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

## SEE ALSO

Refer to search-forward(2) for a description of the magic mode search characters.

replace-string(2), $result(5).
Regular Expressions

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

</HMTL>