SPUG: [OT] procmail extended regexp Re: Regular Expression

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Jul 10 13:33:34 PDT 2005

On Thu, Jul 07, 2005 at 03:05:10PM -0700, John W. Krahn wrote:
> John Costello wrote:
> > On Thu, 7 Jul 2005, Duane Blanchard wrote:
> > 
> >>My favorite online reference is http://www.regular-expressions.info/
> >>which covers more material for more environments than I can fathom.
> > 
> > Related to regular expressions, does anyone know of a good discussion of 
> > procmail's regular expressions?  I encountered an odd example (discussed 
> > earlier this month on LondonPM) in which I wasn't sure if procmail would 
> > treat $? as an environment variable or an optional end-of-line character.
> You can't use quantifiers with zero-width assertions because they match at a 
> position in the string not any characters.  If you want an optional 
> end-of-line you have to do something like "($|)" (match end-of-line or nothing.)

I know you are responding to a question about procmail regular
expressions, but I want to clarify that perl does allow ? or other
quantifiers after zero-width assertions (though I think $? will always
be treated as a variable interpolation, so you'd have to say (?:$)? ).

More information about the spug-list mailing list