You might want to do s/\d/\\d/g before you do s/\w/\\w/g... \w includes \d. As for the process of generating regexes from strings, I don't go near it.
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perlhacker, who'd like a (from-home) job s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;