On Thu, Feb 09 2017, David Bremner <da...@tethera.net> wrote: > Jani Nikula <j...@nikula.org> 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 >> "/<regex>/", 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
a while ago I thought this double // but dismissed it quickly (re-searching just for single quote can be useful...) In the rare cases anyone needs to disable regex processing, imo this \ is the best idea i've (not) come up with. some command line testing with(and -out) quoting: $ printf %s\\n id:\/some/crazy/message-id id:/some/crazy/message-id $ printf %s\\n "id:\/some/crazy/message-id" id:\/some/crazy/message-id $ printf %s\\n 'id:\/some/crazy/message-id' id:\/some/crazy/message-id $ printf %s\\n id:\\/some/crazy/message-id id:\/some/crazy/message-id $ printf %s\\n "id:\\/some/crazy/message-id" id:\/some/crazy/message-id $ printf %s\\n 'id:\\/some/crazy/message-id' id:\\/some/crazy/message-id so: $ printf %s\\n 'id:"\/some/crazy/message-id with spaces"' id:"\/some/crazy/message-id with spaces" > 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. $ printf %s\\n 'id:"'\''/foo with spaces ;D'\''"' id:"'/foo with spaces ;D'" or, perhaps this is clearer >;) $ printf %s\\n 'id:"'"'"'/foo with spaces ;D'"'"'"' id:"'/foo with spaces ;D'" > > 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 _______________________________________________ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch