ts提取html标签中的图片链接

  async extractImg(html: string){
    const arr = html.match(/<img.*?>/g);
    if (arr) return arr.map(item => item.match(/\s+src=['"](.*?)['"]/)![1]);
  }

  

posted @ 2022-08-25 20:30  ㊀觉睡到小时候  阅读(66)  评论(0)    收藏  举报