#!/usr/bin/perl
use strict;
my $test = 'The brown fox int(10) over float(200) fence.';
my %dict = ( 'brown' => 'yellow',
/int(\d+)/ => 'int',
/float(\d+)/ => 'float',
);
for my $i (keys %dict) {
$test =~ s/($i)/$dict{$i}/gi;
}
print "$test\n";
####
The yellow fox float(10) over float(200) fence.
##
##
The yellow fox int over float fence.