in reply to regex find and replace with a twist

I need to find any letter [a-zA-Z] and replace it with [aA][zZ].

I hope I got the brackets right - please use <code> tags for code everywhere, and sample data too. Anyway, unfortunately, your specification is unclear. Your example can be solved with a simple regex (s/([a-zA-Z])/[$1]/g), but I don't understand the above specification, so I don't know if this solves your problem. Please have a look at perlrequick, perlretut, and Re: How to ask better questions using Test::More and sample data, and in the future, please show the code you've tried along with your question as well.