From: Samuel Wales <samologist@gmail.com>
To: hj-orgmode-1@hj.proberto.com
Cc: emacs-orgmode@gnu.org
Subject: Re: advanced search for patterns
Date: Mon, 4 Jan 2021 15:36:19 -0700 [thread overview]
Message-ID: <CAJcAo8s5Tn9e=MKN1XDtT2Bod1xW74EGrhrPMNULC1x=g96rpA@mail.gmail.com> (raw)
In-Reply-To: <10e373e6-cb66-1126-d70b-7e23e2d83535@XXXXXXXXX.XXX>
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 <hj-orgmode-1@hj.proberto.com> wrote:
> 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
>
>
>
--
The Kafka Pandemic
Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
next prev parent reply other threads:[~2021-01-04 22:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 22:19 advanced search for patterns hj-orgmode-1
2021-01-04 22:36 ` Samuel Wales [this message]
2021-01-04 22:38 ` Samuel Wales
2021-01-06 17:28 ` advanced search for patterns [SOLVED] HJ
2021-01-06 20:58 ` Samuel Wales
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJcAo8s5Tn9e=MKN1XDtT2Bod1xW74EGrhrPMNULC1x=g96rpA@mail.gmail.com' \
--to=samologist@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=hj-orgmode-1@hj.proberto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).