Re: Transform part of a message body

udi M <[email protected]> Thu, 21 Jan 2016 17:42:31 +0200
Newsgroups gmane.mail.procmail
Organization tau
Message-ID <[email protected]>
On 21/01/16 17:13, Dale R. Worley
wrote:

"@lbutlr" <[email protected]> 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,}

   Great Dale!  I didn't know that \n can be used in the right
side of

   the command. Thanks.  So, if egrep dosn't like it you can do:

sed -n '/^\(.\)\1\{14,\}$/p'

"\(.\)" 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/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail