<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Fantastic, it works!<br>
<div class="moz-forward-container"> <br>
Just as a suggestion, maybe this tip can be included in the man
pages. Something on the lines of:<br>
<br>
Use <b>folder:"/<regex>/"</b> in case the regex contains
special characters interpretable by Xapian. Double escape as
necesary. For instance:<br>
<br>
notmuch search 'folder:"/^.*/(Junk|Spam)$/"'<br>
<br>
<div class="moz-cite-prefix">On 06/04/18 17:36, David Bremner
wrote:<br>
</div>
<blockquote type="cite" cite="mid:877epkwdn8.fsf@tethera.net">
<pre wrap="">Javier Garcia <a class="moz-txt-link-rfc2396E" href="mailto:javiertury@gmail.com" moz-do-not-send="true"><javiertury@gmail.com></a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">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)$/
</pre>
</blockquote>
<pre wrap="">Try
notmuch search 'folder:"/^.*/(Junk|Spam)$/"'
</pre>
</blockquote>
<br>
</div>
</body>
</html>