function validate(){ var importUrl="test.xlsx"; var d=/.[^.]+$/.exec(importUrl); alert(d); }
参考
https://www.jb51.net/article/111352.htm