in reply to hash key regular expression pattern

Hi! A quick search on the CPAN and I found Tie::RegexpHash, which seems to suit your needs. I've never used it, but here's an example from the man page:
use Tie::RegexpHash; my %hash; tie %hash, 'Tie::RegexpHash'; $hash{ qr/^5(\s+|-)?gal(\.|lons?)?/i } = '5-GAL'; $hash{'5 gal'}; # returns "5-GAL" $hash{'5GAL'}; # returns "5-GAL" $hash{'5 gallon'}; # also returns "5-GAL"

snowcrash