procmail
[Top] [All Lists]

Re: Transform part of a message body

2016-01-21 09:17:29
"@lbutlr" <kremels(_at_)kreme(_dot_)com> writes:
Right, but what I want is to match any lien that contains nothing but
the same characters repeated x times. So I want to match

===============
------------------ 
qqqqqqqqqqqqqqqqqqqq
\\\\\\\\\\\\\\\
/////////////////////////////////
[[[[[[[[[[[[[[[[[[

Etc.

But not match -=-=-=-=-=-=-=-=

Gnu sed (and possibly other sed's) can use this regexp to find the
character sequences you want:

    \(.\)\1{x,}

"\(.\)" matches any single (non-newline) character.  "\1" matches
whatever the "\(.\)" matched (which will be one character).  "\1{x,}",
where you replace "x" with a number, means x or more copies of whatever
the "\(.\)" matched.

You probably want to change "." to be more restrictive.  You can write
"[^ ]" to specify that the character may not be a space, for instance.

Dale
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail