C:\>perl -E "my $num ='abcd23.5fghi';if ($num =~ /[a-z]+(.*)[a-z]/i){ say $1;}" 23.5fgh # not what OP seems to want