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

javascript正则获取a标签的href

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2021-07-13
猜你喜欢
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案