Regex to find the first image in an image tag in an HTML document

前端 未结 3 366
有刺的猬
有刺的猬 2021-01-25 17:03

What is a regex to find the first image in an image tag in an HTML document? My previous tries have not really worked, as they just matched based on .jpg\" and didn

3条回答
  •  囚心锁ツ
    2021-01-25 17:14

    Scraping html, a simple and very loose regex would be: /\

    Using a real DOM parser is of course the preferred method.

提交回复
热议问题