my $filename = 'D:/tmp/Kopie von test.txt'; $filename =~ s{\/[^/].+$}{}gxmi;