procmail
[Top] [All Lists]

protecting trailing space

1996-08-08 11:02:17
This probably is a question for someone who knows how to read the source
code, or for Stephen himself.

What is the best way to write a search string that ends in a trailing space
but still makes the space noticeable to the human eyesight?

I have several conditions in my .procmailrc that search for an expression
that ends in a trailing space.  In order not to delete the trailing space
accidentally, I write those conditions like this:

  * whatever else[ ]

It occurred to me that the use of brackets might not be as efficient there
as parentheses:

  * whatever else( )

or even

  * whatever else ()

Do note that these are not anchored to the end of the line (and in fact there
usually is yet more text on the line), so "$" is not correct here, and the
final character must be specifically a space, so "\>" is too accepting.

I'm sure that the most efficient way is simply to have the trailing space
there in all its undetectable glory, but it's just too easy to lose during an
edit; besides, I have a vi macro that deletes all trailing space that I use
in my .procmailrc to make sure that any continuation backslashes are truly
at the ends of their lines and have nothing after them.

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