📜  从 url 中删除主机名 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:36.898000             🧑  作者: Mango

代码示例1
var URL = "http://localhost:7001/www.facebook.com";
var newURL = URL.replace (/^[a-z]{4,5}\:\/{2}[a-z]{1,}\:[0-9]{1,4}.(.*)/, '$1'); // http or https
alert (newURL);