求一java正则表达式
黄舟
黄舟 2017-04-18 10:45:21
0
1
642
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

membalas semua(1)
迷茫
var url = "http://www.xxx.com/1/2";
var reg = /^(http:\/\/){1}(\w+)(\.){1}(\w+)(\.){1}(\w+)(\/\w)*$/g;
var newUrl = "";

if(reg.test(url)){
  newUrl = "<a href='" + url + "'>";
}

console.log(newUrl);

//result: '<a href=\'http://www.xxx.com/1/2\'>'
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan