我有一个行源代码的看起来像这样的preg_match找IMG SRC特定IMG标签
<img alt="this field is variable" title="this one too" itemprop="photo" border="0" style="width:608px;" src="imgurl.jpg">
有很多网站上的其他图像,所以我不能随便的preg_match所有图像,我需要具体一个,我做了一个特定的preg_match很麻烦,因为“alt”-tag和“title”-tag的内容是可变的。任何人都知道如何去做?提前致谢。
Itemprop =“照片”是这张照片的独特之处。
显然,如果您不告诉我们如何区分_others_img标签和_others_! – arkascha
这些标签是如何突出的,是什么使它们独一无二?如果他们不这样做,反正有它们吗?你有能力给他们添加一些东西吗? –
你可以做[这样的事情](http://stackoverflow.com/questions/6651303/regex-match-img-tag-with-certain-attribute-class),但改变类itemprop否则[这是相当有用的解释正则表达式](http://stackoverflow.com/questions/4231382/regular-expression-pattern-not-matching-anywhere-in-string) – Pete