in reply to Re: Supress similar chars in the string
in thread Supress similar chars in the string
Newer Perls (>=5.10) also allow you to say
s/(.)\1\1\K\1*//g;
i.e., through the use of \K, you don't need to copy the part of the match you want to keep ($1 in your regex) into the substitution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Supress similar chars in the string
by AnomalousMonk (Archbishop) on Jan 18, 2011 at 22:36 UTC |