in reply to Removing characters
However this will clobber lines like this one. Also we are not considering non-alpha at all.s/([a-zA-Z])\1/$1/g; #happy now
For those that are wondering about the \1 & $1: Inside a match use the \1 backreference. Outside use the $1 notation. This doesn't wind up being very important unless you've got more than nine backreferences. \10 is shorthand for \010 which is octal. So if you have 10 or more matches \10 will be the tenth match, otherwise it's octal 10.
|
|---|