I need a short basename function (one-liner ?) for Javascript:
basename(\"/a/folder/file.a.ext\") -> \"file.a\" basename(\"/a/folder/file.ext\") -> \"f
basename = function(path) { return path.replace(/.*\/|\.[^.]*$/g, ''); }
replace anything that ends with a slash .*\/ or dot - some non-dots - end \.[^.]*$ with nothing
.*\/
\.[^.]*$