in reply to Replace $a with $b if $a ne $b

Thank you all for you suggestions. There really are just so many ways to do things that at times it seems like they're hitting me in the face and I don't even notice. Also, thank you jhourcle for clearing up issue with the regular expressions. I was confused about that and hadn't found anything else to explain it.