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?





Rating:
The post regex – Javascript: regexp to remove .html appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/regex-javascript-regexp-to-remove-html.html
Good job!You know I admire you for this matter, so smart you are. I can use it to the Guild Wars 2 Store promoter. Thanks!
ReplyDeleteCherish what you already have and do not feel sorry about what you have lost. Most people just complain all the day and ignore something really important. Be a person who are good at discover the beauty of life. Then you will live a happy one.
ReplyDelete-------------------------------------------------------------------------------------------
Diablo 3 power leveling, D3 power leveling