what's wrong with match() in javascript ?
var path = "D:\Programs\DeveloperTools";
var patt=/.+\\/g;
alert(path.match(patt));
The Result Should Be : D:\Programs\
what's wrong with match() in javascript ?
var path = "D:\Programs\DeveloperTools";
var patt=/.+\\/g;
alert(path.match(patt));
The Result Should Be : D:\Programs\
Escape:
var path = "D:\\Programs\\DeveloperTools";
Now match and alert the path and you will get the expected result. And here's the live demo.