[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Select/highlight and *copy* matches of some regex
From: |
Stephen Berman |
Subject: |
Re: Select/highlight and *copy* matches of some regex |
Date: |
Mon, 27 Jun 2022 22:56:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
On Mon, 27 Jun 2022 17:52:48 +0200 Joost <joostkremers@fastmail.fm> wrote:
> Hi all,
>
> I've been looking for at least an hour for something that my Sublime-using
> colleagues seem to be able to do out of the box... Highlight all matches of
> some regex in the current buffer and then copy/kill *all* of those matches so
> that you can yank them in a new buffer.
>
> The first part, highlighting all matches, is not a problem. But I haven't
> found a way yet to then extract all matches.
Is this (suitably tweaked) good enough?
(let ((matches ""))
(while (re-search-forward "lang=.." nil t)
(setq matches (concat matches (match-string 0) "\n")))
(kill-new matches))
Steve Berman
- Select/highlight and *copy* matches of some regex, Joost, 2022/06/27
- Re: Select/highlight and *copy* matches of some regex, tomas, 2022/06/27
- Re: Select/highlight and *copy* matches of some regex, Joost, 2022/06/27
- Re: Select/highlight and *copy* matches of some regex, Visuwesh, 2022/06/28
- Re: Select/highlight and *copy* matches of some regex, Emanuel Berg, 2022/06/28
- Re: Select/highlight and *copy* matches of some regex, Joost Kremers, 2022/06/29
- Re: Select/highlight and *copy* matches of some regex, Emanuel Berg, 2022/06/30
Re: Select/highlight and *copy* matches of some regex,
Stephen Berman <=
Re: Select/highlight and *copy* matches of some regex, tomas, 2022/06/28