unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Javier Garcia <javiertury@gmail.com>
To: notmuch@notmuchmail.org
Subject: Re: Xapian regex with parentheses fails
Date: Fri, 6 Apr 2018 19:55:01 +0200	[thread overview]
Message-ID: <83f18ad4-65df-2e84-587d-04658d371462@gmail.com> (raw)
In-Reply-To: <cd83e4af-3c0b-ad0a-57a3-244c3dca9297@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Fantastic, it works!

Just as a suggestion, maybe this tip can be included in the man pages.
Something on the lines of:

Use *folder:"/<regex>/"* in case the regex contains special characters
interpretable by Xapian. Double escape as necesary. For instance:

notmuch search 'folder:"/^.*/(Junk|Spam)$/"'

On 06/04/18 17:36, David Bremner wrote:
> Javier Garcia <javiertury@gmail.com> writes:
>
>> Hi,
>>
>> I'm configuring notmuch in a multi-account directory. I want it to tag
>> spam and deleted mails using a post hook. Using regexes with parentheses
>> fails, or perhaps I misunderstood the documentation. The following one
>> liner replicates the problem I face.
>>
>> $ notmuch search 'folder:/^.*/(Junk|Spam)$/'
>> notmuch search: A Xapian exception occurred
>> A Xapian exception occurred parsing query: unmatched regex delimiter in
>> '/^.*/(Junk|Spam'
>> Query string was: folder:/^.*/(Junk|Spam)$/
> Try
>
>  notmuch search 'folder:"/^.*/(Junk|Spam)$/"'
>  


[-- Attachment #2: Type: text/html, Size: 1638 bytes --]

       reply	other threads:[~2018-04-06 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cd83e4af-3c0b-ad0a-57a3-244c3dca9297@gmail.com>
2018-04-06 17:55 ` Javier Garcia [this message]
2018-04-07 22:10   ` [PATCH] doc: add a section on quoting to notmuch-search-terms(7) David Bremner
2018-04-09 21:31     ` Daniel Kahn Gillmor
2018-04-10 19:23     ` Tomi Ollila
2018-04-25  1:58       ` David Bremner
2018-04-25 11:46         ` Tomi Ollila
2018-04-25 12:39           ` David Bremner
2018-04-25  2:11     ` David Bremner
2018-04-04 23:20 Xapian regex with parentheses fails Javier Garcia
2018-04-06 15:36 ` David Bremner

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://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83f18ad4-65df-2e84-587d-04658d371462@gmail.com \
    --to=javiertury@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /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://yhetil.org/notmuch.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).