unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [Patch v4] lib: regexp matching in 'subject' and 'from'
Date: Wed, 25 Jan 2017 22:21:32 -0400	[thread overview]
Message-ID: <87efzqef2r.fsf@tethera.net> (raw)
In-Reply-To: <m2a8afkjxj.fsf@guru.guru-group.fi>

Tomi Ollila <tomi.ollila@iki.fi> writes:

>
> Why would not mesasge_id not be useful to regex match. I can come up quite
> a few use cases... but if there are techinal difficulties... then that
> should be mentioned instead.

I'll have a look. Since the first version of this patch (when that
message was written), people have actually asked for some kind of
wildcard matching of message-ids.

>
> maybe this commit message should inform that xapian with field processors
> (1.4.x) is required for this feature -- and emphasize it a bit better in
> manual page ?
>
> Probably '//' is used to escape '/' -- should such a character ever needed
> in regex search.
>

Currently no escaping is needed because it only looks at the first and
last characters of the string (the usual xapian/shell rules mean that "" might
be needed).

The following seem to work as hoped

# match a / with a space before it

% notmuch search 'subject:"/ //"'

# just a slash

% notmuch search subject:///

# anchored slash

% notmuch search subject:/^//

The trailing slash is actually decorative, we could drop it. Actually
*blush* I just noticed the current code is missing something from this line

         if (str.at (0) == '/' && str.at (str.size () - 1)){

_if_ that line is fixed, then it will have the slightly odd behaviour of

subject:/blah

doing a non-regex search

We could also throw an error for that case, maybe that's the best option.

  reply	other threads:[~2017-01-26  2:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 13:33 [PATCH] lib: regexp matching in 'subject' and 'from' David Bremner
2016-11-14 21:46 ` [Patch v2] " David Bremner
2017-01-18 20:05   ` Jani Nikula
2017-01-18 21:01     ` David Bremner
2017-01-19 12:16       ` [Patch v3] " David Bremner
2017-01-21  3:27         ` [WIP] " David Bremner
2017-01-21 13:59           ` [Patch v4] " David Bremner
2017-01-25 19:40             ` Tomi Ollila
2017-01-26  2:21               ` David Bremner [this message]
2017-01-29 11:23                 ` Jani Nikula
2017-02-05 20:16                   ` Tomi Ollila
2017-02-05 23:28                     ` David Bremner
2017-02-09  3:11                   ` David Bremner
2017-02-09 16:15                     ` Tomi Ollila
2017-02-10  8:29                     ` Mark Walters
2017-02-11 23:25                       ` David Bremner
2017-01-29 11:06               ` Jani Nikula
2017-01-19 14:27   ` [Patch v2] " 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=87efzqef2r.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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).