$ perl -wE '"abcdef" =~ /(.+?)f/ and say $1' abcde