[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regex to match lines with a specific number of words
From: |
Joost Kremers |
Subject: |
Re: Regex to match lines with a specific number of words |
Date: |
Sat, 23 Apr 2022 23:20:58 +0200 |
User-agent: |
mu4e 1.6.10; emacs 28.1.50 |
On Sat, Apr 23 2022, Thibaut Verron wrote:
> The group [:space:] also matches newline characters. So your search has
> exactly one match, spanning many lines.
> You can use [:blank:] instead to match spaces and tabs only, for the
> separator.
Thanks! I never would have thought of that. (Why isn't this mentioned explicitly
in the manual?)
Unfortunately, passing this regexp to `flush-lines` or `kill-matching-lines` in
a file of close to 65000 lines completely cripples Emacs... One CPU core runs up
to 100% and Emacs becomes unresponsive.
Lemme see if a function that goes through the buffer, splits every line on white
space and deletes those that are too long works better.
Thanks, though, for the quick reply!
--
Joost Kremers
Life has its moments
Re: Regex to match lines with a specific number of words, Nick Dokos, 2022/04/26