procmail
[Top] [All Lists]

Re: procmail 3.11pre5 changes

1997-04-04 13:33:00
Edward Sabol wrote about one of the new changes in 3.11pre5:

| >     - Don't strip trailing \n in a $MATCH

| Anybody else besides me think this is a really horrible change? Won't this
| break lots of existing recipes? It will certainly break mine, I think.

I'm wondering whether it will show up that often.  Remember that "." won't
match a newline, so the value of $MATCH after something like this:

    left side\/right side.*

might not include a trailing newline in the first place, whereas after

    left side\/right side$
or  left side\/right side.*$

it will, but how often do we anchor the right side to the end of the line
after \/, where we know that .* will be greedy?  Only some experimentation
will clear it all up.

A problem will come in where you need to anchor the search to the right edge
to check if the condition matches in the first place, and then you wouldn't
want the trailing newline in $MATCH, so you'd need to take an extra step to
strip it:

  * MATCH ?? ^^\/.*

<Prev in Thread] Current Thread [Next in Thread>