On Sun, Sep 30, 2018 at 14:48:55 -0400, Ben Fitzgerald wrote:
> Works okay so far, except when I hit a message with "+" in, for
> example:
> 
> cajxp15h8me6ucystoyuzh_t490x+hoq5dto+xxvozc5wsnh...@mail.gmail.com
> 
> Here when mutt is given:
> 
> / ~i cajxp15h8me6ucystoyuzh_t490x+hoq5dto+xxvozc5wsnh...@mail.gmail.com
> 
> Lookup fails. Simple attempts to work around this such as enclosing the
> Message-ID in single/double quotes, escaping the "+" as below has no effect:
> 
> / ~i "CAJxpU5h8mE6UcYStOyUzH_T490R\+hOp5dTo\+crvozc5wsnh...@mail.gmail.com"
> 
> Probably this is fairly simple, but I'm stuck. Would appreciate advice.

The key thing to remember is that the parsing of the string typed into
the search prompt "uses up" one level of escaping (unless the argument
is inside a single-quote string), and the regular expression itself
uses another level.  So, if you are trying to use a backslash to escape
the "+" in the regular expression, you have to make sure a backslash
survives the parsing step and is included in the regex -- or, you can
instead get the "+" to match using a different sort of "escaping"....

So, (assuming I have cut-and-pasted and counted correctly), the
following should all find the message in question:
/ ~i CAJxpU5h8mE6UcYStOyUzH_T490R\\+hOp5dTo\\+crvozc5wsnh...@mail.gmail.com
/ ~i "CAJxpU5h8mE6UcYStOyUzH_T490R\\+hOp5dTo\\+crvozc5wsnh...@mail.gmail.com"
/ ~i 'CAJxpU5h8mE6UcYStOyUzH_T490R\+hOp5dTo\+crvozc5wsnh...@mail.gmail.com'
/ ~i CAJxpU5h8mE6UcYStOyUzH_T490R[+]hOp5dTo[+]crvozc5wsnh...@mail.gmail.com
/ ~i cajxpu5h8me6ucystoyuzh_t490r.hop5dto.crvozc5wsnh...@mail.gmail.com

(Note that of course the final option will match any character in those
specific positions, rather than only matching a "+" character.)

Hope that makes sense.

                                                Nathan

Reply via email to