in reply to How to do it in one line?
on Unix justperl -wne "s/(.)\1+(?!\1)/length($&)>2?qq[$&]:qq[($1$1)]/ge;print" fil +e.txt
Got same result on your input!perl -wne 's/(.)\1+(?!\1)/length($&)>2?qq[$&]:qq[($1$1)]/ge;print' fil +e.txt
Courage, the Cowardly Dog.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re2: How to do it in one line?
by blakem (Monsignor) on Jul 04, 2002 at 06:49 UTC | |
by r (Initiate) on Jul 04, 2002 at 10:22 UTC |