我想获得第一个 src 属性,我正在使用这个正则表达式,但它会抓取所有 src 属性:
(?<=src=").*?(?=")
例子:
<img src="http://ia.media-imdb.com/images/M/MV5BMTY3NjY0MTQ0Nl5BMl5BanBnXkFtZTcwMzQ2MTc0Mw@@._V1_SY317_CR0,0,214,317_AL_.jpg" />
<img src="http://ia.media-imdb.com/images/M/MV5BMjAzODk4OTI3Ml5BMl5BanBnXkFtZTgwMzU2MTY0MzE@._V1_SX86_CR0,0,86,86_AL_.jpg" />
<img src="http://ia.media-imdb.com/images/M/MV5BNzUzNzY1NzQxM15BMl5BanBnXkFtZTgwMTM0MTY0MzE@._V1_SY86_CR33,0,86,86_AL_.jpg" />
<img src="http://ia.media-imdb.com/images/M/MV5BMTAxNTAwMTg0ODReQTJeQWpwZ15BbWU4MDMzNDE2NDMx._V1_SY86_CR33,0,86,86_AL_.jpg" />