function validate(){ var importUrl="test.xlsx"; var d=/.[^.]+$/.exec(importUrl); ...