查看: 143|回复: 0

[文章教程] 一句话提取字符串中的网址链接

[复制链接]
xuanxiao 发表于 2023-5-31 11:34:28 | 显示全部楼层 |阅读模式
  1. $(".myURL").each(function() {
  2.         var string=this.text;
  3.         console.log(string);
  4.         var matches = string.match(/\bhttps?:\/\/\S+/gi);
  5.         console.log(matches);
  6.         this.href=matches;               
  7.                  
  8. });
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号