使用javascript的img src正则表达式

Regular Expression for img src using javascript

本文关键字:src 正则表达式 img javascript 使用      更新时间:2023-09-26

我想要正则为这个字符串模式:

src="http://www.prphotos.com/f/1335/CSM-001335/Robert-Pattinson,-Reese-Witherspoon-Water-for-Elephants-New-York-City-Premiere---Arrivals.jpg"  border="0"

我正在使用:

<img.['w+'s+'d+'W]*/>

我还必须为不同的语言如javascript,PHP等编写不同的RE吗?

<img [^>]*src=".*?[^']"[^>]*/>

您可能需要将'写成''