in reply to Re: Re: Drop middle part in a substitutionin thread Drop middle part in a substitution
If the filename ends with a newline, you'll end up keeping the last 4 characters instead of the last three. Try:
s/^(.*\.).*(...)\z/$1$2/s; [download]