my $folder_path = "/aboutiso/corp_gov/bod/agendas/2010"; $folder_path =~ s#/\w+/[^/]*.\w+$##; print "folderpath: $folder_path\n";