var file = $("#file").val();
var strFileName=file.replace(/^.+?\\([^\\]+?)(\.[^\.\\]*?)?$/gi,"$1"); //正则表达式获取文件名,不带后缀
var FileExt=file.replace(/.+\./,""); //正则表达式获取后缀
转载于:https://www.cnblogs.com/Rambo-wu/p/5282133.html
var file = $("#file").val();
var strFileName=file.replace(/^.+?\\([^\\]+?)(\.[^\.\\]*?)?$/gi,"$1"); //正则表达式获取文件名,不带后缀
var FileExt=file.replace(/.+\./,""); //正则表达式获取后缀
转载于:https://www.cnblogs.com/Rambo-wu/p/5282133.html