in reply to Removing Adjacent Character Repititions
$string =~ s/(.)\1+/$1/g; # or... #$string =~ tr/A-Za-z0-9//s; $string =~ tr///sc; # update: use this instead
Note that if you use tr///, you have to specify every character you want to match.
Update: Ah, true. Thanks, BrowserUk.
bbfu
Black flowers blossum
Fearless on my breath
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Removing Adjacent Character Repititions
by BrowserUk (Patriarch) on Jan 15, 2003 at 18:13 UTC |