I am searching for some regexp which remove the .html extension of a string.
I already found these two for some reason they don't work:
var path = './views/contacts/node/item.html';
var otherPath = path;
path.replace(/\.[^/.]+$/, '');
console.log(path);
// returns ./views/contacts/node/item.html
otherPath.replace(/(.*)\.[^.]+$/, '');
console.log(otherPath);
// also returns ./views/contacts/node/item.html
Any idea what's wrong?