in reply to Match and extract three characters from the middle of a string

And if the string is variable in length,

my $emc_device = substr($inq, (length($inq) - 3)/2, 3);
--
Leviathan
  • Comment on Re: Match and extract three characters from the middle of a string
  • Download Code