From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AG4cG9CW819ADwAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 22:29:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AEjnFtCW81+dJQAAB5/wlQ (envelope-from ) for ; Mon, 04 Jan 2021 22:29:36 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D9C32940438 for ; Mon, 4 Jan 2021 22:29:35 +0000 (UTC) Received: from localhost ([::1]:56126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwYM1-0005cf-9m for larch@yhetil.org; Mon, 04 Jan 2021 17:29:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwYCN-0005Vb-42 for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 17:19:35 -0500 Received: from mta.vmaly.com ([94.242.65.182]:48550) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwYCK-0001TA-VO for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 17:19:34 -0500 To: emacs-orgmode@gnu.org From: hj-orgmode-1@hj.proberto.com Subject: advanced search for patterns X-Priority: Normal Message-ID: <10e373e6-cb66-1126-d70b-7e23e2d83535@XXXXXXXXX.XXX> Date: Mon, 4 Jan 2021 23:19:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: none client-ip=94.242.65.182; envelope-from=hj-orgmode-1@hj.proberto.com; helo=mta.vmaly.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.33 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D9C32940438 X-Spam-Score: -2.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: 73kEUzQu8FSr hello, I have been using orgmode for a while , and noticed that I can find headings based on tags, but I haven't figured out whether there is a way to say in emacs org-mode :   find me all the (lowest-level) headings [ or heading-paths ] that contains text (whether formatted as source code blocks or whatever) that matches, say three, (regexp) patterns, e.g. :    (M|m)artha    ((buy|bought)[^\n]*milk(s?))    (pay|paid|USD)  How would one ask org-mode to find all such headings (in all opened org-mode buffers , preferably :) )  I guess one could try to connect the three regexps with something like a negative-lookahead "does not contain '\n\*'" string, like    (M|m)artha (:!\n\*){0}   ((buy|bought)[^\n]*milk(s?)) (:!\n\*){0}   (pay|paid|USD)  |  \    (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} ((buy|bought)[^\n]*milk(s?))    |  \    ((buy|bought)[^\n]*milk(s?))  (:!\n\*){0}   (M|m)artha (:!\n\*){0}   (pay|paid|USD)  |  \    (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} ((buy|bought)[^\n]*milk(s?))    |  \     ...  but that's just ugly. And would it work at all? Would it not be so slow to make it impractical?   Or is there a way to say "search all headings for pattern1" in all files, then filter the results by pattern2, then filter the results by pattern3 ?? How? Someone surely must have done this before ...    thx!!     HJ