正则表达式匹配img标签

匹配正则

<img[\s\S]*?>

可以匹配如下内容:

共找到 18 处匹配:
<img border="0"
              alt="?й???????????????" src="//inews.gtimg.com/newsapp_bt/0/0923160330827_8387/0" style="
    width: 128px;
    height: 52px;
">
<img src="https://inews.gtimg.com/news_ls/O8VWMV_iMjXXu1T2IGUqrGplU66hn_yK-TI1i8geGrFAoAA_6.jpg" alt="2222">
<img src="https://inews.gtimg.com/news_ls/OPxKqucmzgM5P1j0u-dLjF6rfBYzdlM4jzuShwi1gt5coAA_870492/0" alt="????????????????50???????????????">
<img src="https://inews.gtimg.com/news_ls/On4qrg8awhGTRifdwMNfB8nHLLxLpnkv7HbF6NP8qcBb4AA_870492/0" alt="NBA?????佱??????????????????FMVP???? ??????MVP">
<img src="https://inews.gtimg.com/om_ls/O9cjSDF-sNyumOSNpAmRehO4I2lI31fYO5BcbCCrhF1ukAA_196130/0" alt="??????????????α????">
<img src="//inews.gtimg.com/newsapp_bt/0/202308169094324736331/0" alt="????????????????¥???????">
<img src="//inews.gtimg.com/newsapp_bt/0/0613150938895_706/0" style="vertical-align: middle;margin-left: 5px;">
<img
              width="44" height="44" border="0" alt="?й??????????????"
              src="//inews.gtimg.com/newsapp_bt/0/0923160410686_7902/0">
<img border="0" alt="???????"
              src="//inews.gtimg.com/newsapp_bt/0/0923160441309_8267/0">

匹配img标签里面src,正则

(?<=src\s*=\s*\")\S+(?=\"{1})

你可能感兴趣的:(正则表达式,正则表达式)