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])