in reply to regex s/// using hash

my $re = join '|', keys %dict;

It's worth noting that the keys will be interpreted as regexes, which is not always what you want. If you don't want that, use

my $re = join '|', map { quotemeta $_ } keys %dict;
instead