Questions tagged [query-replace-regexp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
19 views

How can I catch a block of text to be used in a replacement-part code?

I want to save a block of text in a variable and then do a replacement using that variable in the replacement part. For instance, suppose to do the following replacement: block_of_text ---> \...
1
vote
0answers
50 views

How to replace a block of text with a “query-like” approach all at once?

I want to search and replace a block of text with a "query-like" approach all at once. For example, if I have \emph{``Foo $\bar$ baz''} to be replaced by \emph{Foo $\bar$ baz} using a &...
1
vote
1answer
35 views

How can I get the search string from incremental regexp search to use with replace regexp

If I want to do a replace-regexp I usually start with a isearch-forward-regexp so I can get immediate visual feedback on the search string. From there I'd like to grab the search string for using in ...
0
votes
1answer
33 views

.+$ fails to match remainder of line

This matches nothing: Query replace regexp (default \.org.+ → ): \.org.+$ → The same without '$' matches incompletely: I'd like to be able to match \.org and all that follows.
0
votes
1answer
37 views

Regexp: how to search-replace any html attribute in current buffer

Disclaimer: I'm still trying to learn elisp so I have not gotten yet to the RegExp section of the Elisp intro or Emacs manual. I would like to know how to search and replace an HTML buffer that has ...
1
vote
1answer
48 views

How to replace strings including `.` (dot) as first character using dired-do-find-regexp-and-replace

(defun my-find-orgfiles () (interactive) (find-name-dired "." "*py")) (global-set-key (kbd "M-n") 'my-find-orgfiles) Than, t to toggle marked/unmarked files (thus marking them all, since none ...
0
votes
2answers
61 views

query-replace{-regexp} fails in linux in a non-X terminal when I am in anything other than text mode

I am running emacs 26.1 under linux. It has been working fine for over a year. Recently, I upgraded a lot of packages on my machine, but I did not upgrade nor alter emacs in any way. Now, query-...