GNU bug report logs - #31796
26.1; dired-do-find-regexp-and-replace fails to find multiline regexps

Previous Next

Package: emacs;

Reported by: Žygimantas Bruzgys <me <at> zygi.xyz>

Date: Tue, 12 Jun 2018 07:56:03 UTC

Severity: minor

Found in version 26.1

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, abela <at> chalmers.se, 31796 <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: bug#31796: 27.1; dired-do-find-regexp-and-replace fails to find multiline regexps
Date: Tue, 1 Dec 2020 17:20:47 +0200
On 01.12.2020 10:36, Juri Linkov wrote:
>>> It is possible to combine with sed:
>>> https://www.gnu.org/software/sed/manual/html_node/Text-search-across-multiple-lines.html
>>> https://www.gnu.org/software/sed/manual/html_node/Multiline-techniques.html#Multiline-techniques
>>
>> It's pretty much Chinese to me, sorry.
> 
> When I need to grep in multi-line mode I use Ruby, but its modifiers
> differ from Perl:
> 
> https://regular-expressions.mobi/ruby.html
>    /m makes the dot match newlines.  Ruby indeed uses /m, whereas Perl and
>    many other programming languages use /s for “dot matches newlines”.
> 
> https://www.regular-expressions.info/modifiers.html
>    (?s) for “single line mode” makes the dot match all characters,
>         including line breaks.  Not supported by Ruby or JavaScript.
>    (?m) for “multi-line mode” makes the caret and dollar match at the start
>         and end of each line in the subject string.  In Ruby, (?m) makes the
>         dot match all characters, without affecting the caret and dollar which
>         always match at the start and end of each line in Ruby.

Ruby's much easier for me, of course, but it doesn't have the same 
advantage of ubiquity that awk (and, to a lesser extent, perl) have.

Either way, someone would need to write that script.




This bug report was last modified 4 years and 246 days ago.

Previous Next


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