From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id AF8856DE16E2 for ; Wed, 8 Feb 2017 19:11:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DOb0ZvO9Bf9s for ; Wed, 8 Feb 2017 19:11:54 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id D35326DE1678 for ; Wed, 8 Feb 2017 19:11:53 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cbf8b-00007z-4y; Wed, 08 Feb 2017 22:11:13 -0500 Received: (nullmailer pid 13443 invoked by uid 1000); Thu, 09 Feb 2017 03:11:43 -0000 From: David Bremner To: Jani Nikula , Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [Patch v4] lib: regexp matching in 'subject' and 'from' In-Reply-To: <87ziia2jpj.fsf@nikula.org> References: <20170121032752.6788-1-david@tethera.net> <20170121135917.22062-1-david@tethera.net> <87efzqef2r.fsf@tethera.net> <87ziia2jpj.fsf@nikula.org> Date: Wed, 08 Feb 2017 23:11:43 -0400 Message-ID: <87efz8vz0w.fsf@rocinante.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 03:11:54 -0000 Jani Nikula writes: > > Theoretically "/" is an acceptable character in message-ids [1]. Rare, > unlikely, but acceptable. Searching for message-id's beginning with "/" > would have to use regexps, which would break in all sorts of ways > throughout the stack. I don't think there are handy alternatives to > "//", given the characters that are acceptable in message-ids, > but this is something to think about. Would telling the user to \ escape ( or double /) the initial / be good enough there? This would disable regex processing. I guess this goes back to someone's earlier suggestion. A third option would be to use single quotes there ("id:'/foo'"), but that isn't really consistent with either Xapian or usual regex conventions. So I guess my favourite idea ATM is to use id:\/some/crazy/message-id FWIW, I don't have any such message ids. > For example, could the regexp matcher for message-ids first check if the > "regexp" is a strict match with "/" and all, and accept those? This > might be a reasonable workaround if it can be made to work. We're building a query, so I think the equivalent is to make an OR, with the exact match and the regex posting source. That could be done, although I'm a bit uneasy about how this makes the syntax for id: different, so id:/foo would be legit, but from:/foo would be an error. Maybe the dwim-factor is worth it. d