From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: How to grep for a string spanning multiple lines? Date: Sat, 26 Nov 2022 09:36:06 +0100 Message-ID: References: <8735a6cj2k.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MpaLPtzdAAKARINS" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5241"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 09:36:41 2022 Return-path: Envelope-to: geh-help-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 1oyqfx-0001B3-Dn for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 09:36:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyqfY-00021B-L0; Sat, 26 Nov 2022 03:36:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyqfW-00020D-Gx for help-gnu-emacs@gnu.org; Sat, 26 Nov 2022 03:36:14 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyqfU-0000zZ-Jo for help-gnu-emacs@gnu.org; Sat, 26 Nov 2022 03:36:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=P3kOEmql2i5Vzc3bSWHuGbWlofw2tmyp3kmMwQ4fg9I=; b=dMNwb80kTz6zPoHTgBNStKCcn5 pD7lXVRM7LmDs4YtTLQLbAF0Zgddxo0wZ+etebKQHtxqJ5Vqv1ot6Ylb19jv/q0+yLJPTESBebSVS 7tItTUDom51odvG6eHHknYoRpdDes522r2wLeig6aWQS4WaSKZDhFt0ZIXVlhjpzmRc4XJpJdtt3w 2S6IeqDSo6MlMNknRmw9WaqwuI5hXzdo9BWzhEzPKjkjxfI33RiadL7TCOaDOmyDV9DCG53sPkk7B 6I/J+mmCaiboJZu39vmVwC4yqKlfvMmg25pO/Cq95rg2Qm5btL436mhfJy6ZLVvcbpFzENaffJb30 ANhuXaAA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1oyqfO-0007l1-8I for help-gnu-emacs@gnu.org; Sat, 26 Nov 2022 09:36:06 +0100 Content-Disposition: inline In-Reply-To: <8735a6cj2k.fsf@mbork.pl> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141163 Archived-At: --MpaLPtzdAAKARINS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 26, 2022 at 07:42:59AM +0100, Marcin Borkowski wrote: > Hi all, >=20 > assume I have a file (probably an Org mode one) with some stuff > I archived from the 'net. (I'm going to start to sue > youtube-sub-extractor.el.) Here is my problem: assume I remember that > someone in some video said something, and I want to find that part. > However, it turns out that it is split between two (or more) lines. >=20 > Traditional `grep' is not helpful in this situation. Neither is > isearch, nor swiper. One idea would be to convert the subtitles to one > long line (which is an option), but are there any other ways to search > for a string spanning more than one line (and not knowing which words > are separated by a space and which ones by a newline)? >=20 > Both Emacs-y and shell-y tools would be appreciated. Note that, at least, in Emacs, the POSIX character class [:space:] also matches line breaks. So if you always use [[:space:]]+ to separate your words, you might find what you are looking for. Cheers --=20 t --MpaLPtzdAAKARINS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY4HP9gAKCRAFyCz1etHa RuGVAJwMNyMexYdQ2sXbN7mOD7XIL+XWbQCeKO9DRMIZLz68cEcqB5+Xq1PicIA= =p2L2 -----END PGP SIGNATURE----- --MpaLPtzdAAKARINS--