简体   繁体   中英

Regular Expression for img src using javascript

I want RE for this string pattern:

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

I am using:

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

Also do I have to write different RE for different languages like javascript,PHP etc?

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

您可能需要将\\写为\\\\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM