GNU bug report logs - #10885
Replace expressions: enhance functionality when searching in filled paragraphs

Previous Next

Package: emacs;

Reported by: linuxfever <linuxfever <at> yahoo.gr>

Date: Sun, 26 Feb 2012 01:31:01 UTC

Severity: wishlist

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: linuxfever <linuxfever <at> yahoo.gr>
Cc: 10885 <at> debbugs.gnu.org
Subject: bug#10885: Replace expressions: enhance functionality when searching in filled paragraphs
Date: Sat, 25 Feb 2012 20:57:05 -0500
linuxfever wrote:

> Currently it seems that when trying to replace an expression comprising two
> words, say for example 'replace this', then the functions 'replace-string'
> or 'replace-regexp' fail to locate the expression when that is split along
> two lines in the text, i.e., in the above example when the word 'replace' is
> at the end of one line, and the word 'this' is at the beginning of the next
> one.

You can use query-replace-regexp for this.

Sample input:

This is text. This is text. This is text. This is text. Replace this.
This is text. This is text. This is text. This is text. This is text. Replace
this.
Replace                    this.

M-x query-replace-regexp RET \(replace\)\([ ^I^J]*\)\(this\) RET Done\2that RET

Output:

This is text. This is text. This is text. This is text. Done that.
This is text. This is text. This is text. This is text. This is text. Done
that.
Done                    that.




This bug report was last modified 12 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.