191
rated 0 times
[
193]
[
2]
/ answers: 1 / hits: 18060
/ 11 Years ago, thu, october 10, 2013, 12:00:00
Hello i need to match filnames with extensions.
Problem is that paths could be both unix and windows, so seperated by / or also unix allows . in filenames, so t.est.txt also should be matched.
My code :
var regex = new RegExp('[\/]?([/w+.]+/w+)/s*$');
var value = this.attachment.fileInput.dom.value;
console.log(value.match(regex));
console.log(regex.exec(value));
this regex works fine in rubular. But for some reason ie, chrome and firefox does not match any string and returns null.
More From » regex