Subject: Re: Sieve regex extension

From: Ken Murchison <[email-masked]>
Date: Wed, 01 Mar 2000 09:39:17 -0500

Tim Showalter wrote:
> 
> Randall Gellens <[email-masked]> writes:
> 
> > At 3:17 PM -0500 2/9/00, Ken Murchison wrote:
> >
> > >CMU Sieve currently strips all single backslashes in quoted strings,
> > >which seems to be one reasonable implementation based on the working in
> > >the spec.  This behavior requires that any escaped meta-character in a
> > >regex must be preceded by two backslashes.  This behavior also effects
> > >the :matches match-type in the base spec and imapflags as defined in
> > >draft-melnikov-sieve-imapflags-02.
> > >
> > >I am not up to speed on the discussions that led to the current wording
> > >in the spec, but I'd like to see all escape sequences passed through
> > >untouched, or perhaps be context-sensitive as hinted at in the spec.
> > >But, "this is just my opinion, and I could be wrong."
> >
> > I agree with you.  Two backslashes should mean one literal backslash.
> > "\." in a regexp should mean a literal dot.  "\\." should mean a
> > literal backslash followed by any character.  Otherwise it's too
> > confusing.
> 
> I believe that this is impossible to correctly parse without passing
> information between the parser and the lexer in a very unsavory way.
> In particular, if you're trying to decide what a backslash means at
> the lexer level, you can't, and you have to wait until the string is
> used in context.
> 
> I'm not happy that the spec says what it does.  It was a mistake.
> 
> For consistancy, I believe only \ and \" should be significant in a
> string; to escape a metacharacter, the syntax should be "\\?" (i.e.,
> match a literal question mark).  The sequence "\\\?" is not
> syntactically legal.
> 
> Programmers can grasp this (it's what C, Perl, and some Lisp
> implementations do) and no one else will understand it, no matter what
> we decide.
> 
> I would like to change the spec to reflect the behavior implemented in
> CMU's Sieve implementation.

Tim,

When might you get to this?  Alexey suggested that I add an example or
two to the regex spec, but I want this to jive with the wording in the
base spec.

Ken
-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

---

From: Matthew Wall <[email-masked]>
Date: Wed, 01 Mar 2000 16:07:07 -0500

-- On Wednesday, March 1, 2000 9:39 AM -0500 the entity known as Ken 
Murchison <[email-masked]> wrote:

<begin quote>

> two to the regex spec, but I want this to jive with the wording in the

<end quote>

To which Matthew Wall offers this response on Wed, 01 Mar 2000 16:05:14 
-0500:

Yah, in point of fact, let me generalize this and suggest there's enough 
modest implementation experience that we should do a last round of 
revisions and submit this for extended last call. Time's a wastin'.

???

- Matt

---

From: Tim Showalter <[email-masked]>
Date: 01 Mar 2000 14:02:58 -0800

> revisions and submit this for extended last call. Time's a wastin'.

I'm pretty busy at the moment.  I will try and get a draft out soon.
If everyone is fine with the semantic I want changed, then I'll change
it in the document and hopefully get it out sometime next week, and
then head for last call.

I believe I should also last call the vacation extension at the same
time.  If you happen to agree, now would be an excellent time to read
it and send me corrections.

Tim

---

From: Matthew Wall <[email-masked]>
Date: Wed, 01 Mar 2000 18:11:30 -0500

-- On Wednesday, March 1, 2000 2:02 PM -0800 the entity known as Tim 
Showalter <[email-masked]> wrote:

<begin quote>

<end quote>

To which Matthew Wall offers this response on Wed, 01 Mar 2000 18:11:23 
-0500:

Agreed, and I will 8-).

- mw

---

From: Ken Murchison <[email-masked]>
Date: Thu, 02 Mar 2000 20:37:21 -0500

> it and send me corrections.

Unless I'm reading this line from [VACATION] incorrectly:

"If the parameter given to ":days" is greater than the minimum value,
then the minimum value is used instead." 

Shouldn't this read "less than" instead of "greater than"?

Ken