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.
In reply to Re: How to do it in one line?
by Courage
in thread How to do it in one line?
by r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |