<<< Date Index >>>     <<< Thread Index >>>

Re: IMAP server side search integration



On Mon, Sep 05, 2005 at 10:51:03AM -0700, Brendan Cully wrote:
> On Monday, 05 September 2005 at 19:06, Oswald Buddenhagen wrote:
> > On Mon, Sep 05, 2005 at 09:31:00AM -0700, Brendan Cully wrote:
> > > This patch adds a '$' modifier to the pattern language that turns
> > > regexp searches into simple string matches.
> > > 
> > > Examples:
> > > ~b mutt: client regexp match
> > > 
> > i for one would change the ~ to = instead of prepending $ - less to type
> > and more intuitive (to somebody with perl knowledge ;).
> 
> Good idea. It gets rid of the nasty nested modifier semantics
> too. Here's a patch that adds a = operator, identical to ~ but
> produces a string match instead of a regexp match. It still does an
> implicit string match if the regexp contains no metacharacters.

I just wonder about:

+  /* If there are no RE metacharacters, use simple search anyway */
+  if (!pat->stringmatch && !strpbrk (buf.data, "|[{.*+?^$"))
+    pat->stringmatch = 1;

I don't think the '|' character impiles RE does it? There is an "OR" key
in the imap search command to which it will map - ah I see.. One would
then need to alter the pattern to s/|/ OR / ..

Cheers,

Patrick