$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
In reply to Re: Removing Adjacent Character Repititions
by bbfu
in thread Removing Adjacent Character Repititions
by jupe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |