in reply to Storing substitution patterns

Strange. I would have thought that the /e modifier would do what you want. You can always wrap the entire substitution in an eval like so:

eval "\$string =~ s/$regexes{$re}[0]/$regexes{$re}[1]/i";