js正则获取a标签的href
let str = '<a href="https://www.test.com" >test</a>' let reg = /((\w+):\/\/)?([\w.]+[.]{1})[\w]+/ console.log(str.match(reg)[0])
2022-11-08 15:56:11
js正则获取a标签的href
let str = '<a href="https://www.test.com" >test</a>' let reg = /((\w+):\/\/)?([\w.]+[.]{1})[\w]+/ console.log(str.match(reg)[0])