From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#31796: 27.1; dired-do-find-regexp-and-replace fails to find multiline regexps Date: Tue, 01 Dec 2020 10:36:38 +0200 Organization: LINKOV.NET Message-ID: <87czzudk6p.fsf@mail.linkov.net> References: <10120030-8b8d-b702-add4-8f099f934ed5@chalmers.se> <831rgivl7l.fsf@gnu.org> <83lfequ30g.fsf@gnu.org> <83a6v6tss9.fsf@gnu.org> <08c0bbce-051e-7a49-106a-d6d0629b2224@yandex.ru> <834kl6lv5f.fsf@gnu.org> <43b0d5df-a4e7-e8a7-d6cf-5dc6bc7a52cf@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4289"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: abela@chalmers.se, 31796@debbugs.gnu.org, Jean Louis To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 01 09:56:45 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kk1Sn-00010D-BG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 09:56:45 +0100 Original-Received: from localhost ([::1]:39798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk1Sm-000326-Cw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 03:56:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk1S7-0002Xy-1a for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 03:56:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kk1S6-0002DK-Qk for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 03:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kk1S6-0003WZ-QQ for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 03:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Dec 2020 08:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31796 X-GNU-PR-Package: emacs Original-Received: via spool by 31796-submit@debbugs.gnu.org id=B31796.160681292513480 (code B ref 31796); Tue, 01 Dec 2020 08:56:02 +0000 Original-Received: (at 31796) by debbugs.gnu.org; 1 Dec 2020 08:55:25 +0000 Original-Received: from localhost ([127.0.0.1]:57725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk1RU-0003VM-Nv for submit@debbugs.gnu.org; Tue, 01 Dec 2020 03:55:25 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk1RM-0003Ua-TX for 31796@debbugs.gnu.org; Tue, 01 Dec 2020 03:55:23 -0500 X-Originating-IP: 91.129.99.98 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 990D11BF208; Tue, 1 Dec 2020 08:55:08 +0000 (UTC) In-Reply-To: <43b0d5df-a4e7-e8a7-d6cf-5dc6bc7a52cf@yandex.ru> (Dmitry Gutov's message of "Tue, 1 Dec 2020 03:23:00 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194710 Archived-At: >> 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.