• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

请问个正则表达式

php 搞代码 4年前 (2022-01-24) 37次浏览 已收录 0个评论

请教个正则表达式
“,”bdSourceName”:””,”bdFromPageTitlePrefix”:””,”token”:”8095″},{“thumbURL”:”http://t2.baidu.com/it/u=2984778172,1478112097&fm=0&gp=0.jpg&#8221;,”middleURL”:”http://t2.baidu.com/it/u=2984778172,1478112097&fm=51&gp=0.jpg&#8221;,”largeTnImageUrl”:”http://t2.baidu.com/it/u=2984778172,1478112097&fm=52&gp=0.jpg&#8221;,”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<\/strong> 530li<\/strong>典雅型 “,”bdSourceName”:””,”bdFromPageTitlePrefix”:””,”token”:”9011″},{“thumbURL”:”http://t3.baidu.com/it/u=167097252,823550504&fm=0&gp=0.jpg&#8221;,”middleURL”:”http://t3.baidu.com/it/u=167097252,823550504本文@来#源gaodai$ma#com搞$$代**码网搞代gaodaima码&fm=51&gp=0.jpg”,”largeTnImageUrl”:”http://t3.baidu.com/it/u=167097252,823550504&fm=52&gp=0.jpg&#8221;,”hasLarge” : 0,”pageNum”:41,”objURL”:”http://www.2sauto.net/db/upload/s_20081013200290.jpg

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

——解决方案——————–

PHP code

$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 ","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<\/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]);


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:请问个正则表达式
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址