From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OzxrL5OY81/NIwAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 22:37:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id r1YLK5OY81/jMQAA1q6Kng (envelope-from ) for ; Mon, 04 Jan 2021 22:37:07 +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 3DAFD94062D for ; Mon, 4 Jan 2021 22:37:07 +0000 (UTC) Received: from localhost ([::1]:38064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwYTI-0001wN-Q4 for larch@yhetil.org; Mon, 04 Jan 2021 17:37:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwYSe-0001vq-HQ for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 17:36:24 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:33420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwYSc-0007dV-0f for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 17:36:24 -0500 Received: by mail-lf1-x134.google.com with SMTP id l11so68281224lfg.0 for ; Mon, 04 Jan 2021 14:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=likDKoILm2VFwhd6xHbXhiEYysFkvCvVZDqd3FTljkc=; b=eFjAhAMzkhu6NT4maRN2mE34kJBwlApqDJYZHjynA94oTeg7wdZF7JyGNO5kLqP8PW Fd3UvvkyIiCA7A0PCRYKsmtFjnaeDCQgK8d2OZK1pSyk2lFewmVwuskgS5cNfCUk0Ulq SqVYugMAWEj22saTzxVTe1l1YMRa1f/smETL7b+qJqY9+YuQMq09CUGtW6RrnJjFOvUl KYaZCxJ7iZQ5S5ab8RpuQay4ZhxKOTKQe7Z01thJ7+MbOE8/9D917OLkKdb7atcYOeBe m+JJhYEWXu/GTtysRaessliuzMl8Y9uc+bucUj6waHtAgHD5djdMb/sTMSiYb3UNDYap b4ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=likDKoILm2VFwhd6xHbXhiEYysFkvCvVZDqd3FTljkc=; b=fmSpE5MQUaG+hsaayXoHVza+9mPb8Y5E2IVcbF5dqgTrqvmO7AAG111Jtb8eGDfB+0 qzrjzOeEk62/3KI4JU5QYvNrTHJ3EiR9VQcSiMTLmG3VqMv4V20bgIEojCAzj/DAPE1h f7AaAtxg7p2YVM08FNSjalDiK6ZaLD5XBhOZ1CfwcUacAWkzIfR2RSrQU7EWsdotpmd6 l8kXKJ9CNk6AYiRv0Vp44D5elCp5OfcKVNWNrgOlumL6Wit1d4eqx1sZ1L/xjP3JFnKb BYqJxPj7IVPVM9wqP5IgE/pBqLxozCE6FxlfcQZTHz/Ej2PbdzbOGoLwmOgq43MbNtHn SJJg== X-Gm-Message-State: AOAM532yvm9kXtyJTxNaLg0pOQJMojoTnkLdcGBA+X5Hc5RFnCQ7LTlb hB51RmUzQ/6U6LEoZK+P7bxSLw0GYQrEKx3HBww= X-Google-Smtp-Source: ABdhPJxs38rz2zUswFiV5aY4T4jN5DkMpCcNGrGo7oEj1dl0Ow012CniWl7nTlPY/eE4eknytKEQmeuq4JN5vo/ADS8= X-Received: by 2002:ac2:5f68:: with SMTP id c8mr18624465lfc.140.1609799779644; Mon, 04 Jan 2021 14:36:19 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab3:4a02:0:0:0:0:0 with HTTP; Mon, 4 Jan 2021 14:36:19 -0800 (PST) In-Reply-To: <10e373e6-cb66-1126-d70b-7e23e2d83535@XXXXXXXXX.XXX> References: <10e373e6-cb66-1126-d70b-7e23e2d83535@XXXXXXXXX.XXX> From: Samuel Wales Date: Mon, 4 Jan 2021 15:36:19 -0700 Message-ID: Subject: Re: advanced search for patterns To: hj-orgmode-1@hj.proberto.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=samologist@gmail.com; helo=mail-lf1-x134.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=eFjAhAMz; dmarc=pass (policy=none) header.from=gmail.com; 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: 3DAFD94062D X-Spam-Score: -3.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: m+q/chDtVEAD with the correct variable settings, i think you can do {pat1} {pat2} {pat3} -{pat4} you can check the manual for the search settings. On 1/4/21, hj-orgmode-1@hj.proberto.com wrot= e: > 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 : > > =C2=A0 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. : > > =C2=A0=C2=A0 (M|m)artha > =C2=A0=C2=A0 ((buy|bought)[^\n]*milk(s?)) > =C2=A0=C2=A0 (pay|paid|USD) > > =C2=A0How would one ask org-mode to find all such headings (in all opene= d > org-mode buffers , preferably :) ) > > =C2=A0I guess one could try to connect the three regexps with something = like > a negative-lookahead "does not contain '\n\*'" string, like > > =C2=A0=C2=A0 (M|m)artha (:!\n\*){0}=C2=A0=C2=A0 ((buy|bought)[^\n]*milk(= s?)) (:!\n\*){0} > (pay|paid|USD)=C2=A0 |=C2=A0 \ > =C2=A0=C2=A0 (pay|paid|USD)=C2=A0 (:!\n\*){0} (M|m)artha (:!\n\*){0} > ((buy|bought)[^\n]*milk(s?))=C2=A0=C2=A0=C2=A0 |=C2=A0 \ > =C2=A0=C2=A0 ((buy|bought)[^\n]*milk(s?))=C2=A0 (:!\n\*){0}=C2=A0=C2=A0 = (M|m)artha (:!\n\*){0} > (pay|paid|USD)=C2=A0 |=C2=A0 \ > =C2=A0=C2=A0 (pay|paid|USD)=C2=A0 (:!\n\*){0} (M|m)artha (:!\n\*){0} > ((buy|bought)[^\n]*milk(s?))=C2=A0=C2=A0=C2=A0 |=C2=A0 \ > =C2=A0=C2=A0=C2=A0 ... > > =C2=A0but that's just ugly. And would it work at all? Would it not be so > slow to make it impractical? > > =C2=A0 Or is there a way to say "search all headings for pattern1" in al= l > files, then filter the results by pattern2, then filter the results by > pattern3 ?? How? Someone surely must have done this before ... > > > =C2=A0=C2=A0 thx!! > > =C2=A0=C2=A0=C2=A0 HJ > > > --=20 The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged= .html