procmail
[Top] [All Lists]

Re: Eliminating Linefeed embedded in a $MATCH result

1999-04-30 10:18:25
Rik Kabel wrote about his own suggestion for Ralph Sobek,

|  If the last line is the only line, the resulting MATCH will include
|  trailing whitespace. If the last line is not the only line, the
|  resulting MATCH will have as many characters as possible up to the
|  final non-whitespace character.

If Ralph wants multiline matches but not the final newline on the last line
of the matched text, nor any closing empty lines but just up through the
last non-newline character from the first match,

  * MATCH ?? ^^\/(.*$)*.+

That does assume the existence of at least one non-newline character in the
previous value of MATCH, as does my previous recommendation for truncating
MATCH down to its first line without a trailing newline (in fact, it assumes
a non-newline character in that first line):

  * MATCH ?? ^^\/.+

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