emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: advanced search for patterns


From: Samuel Wales
Subject: Re: advanced search for patterns
Date: Mon, 4 Jan 2021 15:36:19 -0700

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]