ホームページ  >  記事  >  バックエンド開発  >  正規表現を教えてください

正規表現を教えてください

WBOY
WBOYオリジナル
2016-06-13 13:18:23940ブラウズ

请教个正则表达式
","bdSourceName":"","bdFromPageTitlePrefix":"","token":"8095"},{"thumbURL":"http://t2.baidu.com/it /u=2984778172,1478112097&fm=0&gp=0.jpg","middleURL":"http://t2.baidu.com/it/u=2984778172,1478112097&fm=51&gp=0.jpg","largeTnImageUrl":"http ://t2.baidu.com/it/u=2984778172,1478112097&fm=52&gp=0.jpg","hasLarge" : 0,"pageNum":40,"objURL":"http://www.che51.com /UploadFiles/image/Gallery/2_Pic_200912250127432009.jpg ","fromURL":"http://www.che51.com/picture/carinfo.aspx?car_id=1781&carserialsid=227 ","fromURLHost":"http://www .che51.com ","currentIndex":"28638 ","width":174,"height":121,"type":"jpg","filesize":"52","bdSrcType":"0", "di":"64754191000","is":"0,0","bdSetImgNum":0,"bdImgnewsDate":"1970-01-01 08:00","fromPageTitle":"新bmw< ;/強い> 530li典雅型 ","bdSourceName":"","bdFromPageTitlePrefix":"","token":"9011"},{"thumbURL":"http://t3.baidu. com/it/u=167097252,823550504&fm=0&gp=0.jpg","middleURL":"http://t3.baidu.com/it/u=167097252,823550504&fm=51&gp=0.jpg","largeTnImageUrl" :"http://t3.baidu.com/it/u=167097252,823550504&fm=52&gp=0.jpg","hasLarge" : 0,"pageNum":41,"objURL":"http://www. 2sauto.net/db/upload/s_20081013200290.jpg "

我想提取objURL後の纯网址,请问怎么办?谢谢

------解决方案- -------------------

PHP コード
$s=<<<txt
","bdSourceName":"","bdFromPageTitlePrefix":"","token":"8095"},{"thumbURL":"http://t2.baidu.com/it/u=2984778172,1478112097&fm=0&gp =0.jpg","middleURL":"http://t2.baidu.com/it/u=2984778172,1478112097&fm=51&gp=0.jpg","largeTnImageUrl":"http://t2.baidu.com /it/u=2984778172,1478112097&fm=52&gp=0.jpg","hasLarge" : 0,"pageNum":40,"objURL":"http://www.che51.com/UploadFiles/image/Gallery/2_Pic_200912250127432009 .jpg ","fromURL":"http://www.che51.com/picture/carinfo.aspx?car_id=1781&carserialsid=227 ","fromURLHost":"http://www.che51.com ","currentIndex ":"28638 ","幅":174,"高さ":121,"タイプ":"jpg","ファイルサイズ":"52","bdSrcType":"0","di":"64754191000", "is":"0,0","bdSetImgNum":0,"bdImgnewsDate":"1970-01-01 08:00","fromPageTitle":"新<strong>bmw</strong> <strong>530li</strong>典雅型 ","bdSourceName":"","bdFromPageTitlePrefix":"","token":"9011"},{"thumbURL":"http://t3.baidu. com/it/u=167097252,823550504&fm=0&gp=0.jpg","middleURL":"http://t3.baidu.com/it/u=167097252,823550504&fm=51&gp=0.jpg","largeTnImageUrl" :"http://t3.baidu.com/it/u=167097252,823550504&fm=52&gp=0.jpg","hasLarge" : 0,"pageNum":41,"objURL":"http://www. 2sauto.net/db/upload/s_20081013200290.jpg "
TXT;
preg_match_all('/"objURL":"(.+)"/sU',$s,$m);
print_r($m[1]); <div class="clear"></div>
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。