in reply to Match and extract three characters from the middle of a string
$inq = "23D78000"; ($junk, $emc_device, $junk1) = ($inq =~ /^(.*)(\w{3})(\w{3})$/); print "Result: [$junk], [$emc_device], [$junk1]"; #Result: [23], [D78], [000] [download]