note 73036 added to function.preg-match
| From: | izua dot richard at gmail dot com | Date: | Wed, 07 Feb 2007 05:04:17 +0000 |
| Subject: | note 73036 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123027@lists.php.net to get a copy of this message | ||
Be careful when mixing curl with preg_match.
If you view the source from one browser, set the CURLOPT_USERAGENT as the same string supplied by
the browser. I lost over three hours figuring out why this regular expression
/<h2 class=r><a href=([\s\S]+?) class=l>([\s\S]+?)<\/a><\/h2>/
won't actually give me the link and name of search results (google search). I was reading the
source from Opera, and identifying myself as Mozilla from curl.
i know it's really out of topic, but it looked to me like a preg_match bug at first.
----
Server IP: 69.147.83.197
Probable Submitter: 86.121.131.197
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/73036
Del: integrated -- https://master.php.net/note/delete/73036/integrated
Del: useless -- https://master.php.net/note/delete/73036/useless
Del: bad code -- https://master.php.net/note/delete/73036/bad+code
Del: spam -- https://master.php.net/note/delete/73036/spam
Del: non-english -- https://master.php.net/note/delete/73036/non-english
Del: in docs -- https://master.php.net/note/delete/73036/in+docs
Del: other reasons-- https://master.php.net/note/delete/73036
Reject -- https://master.php.net/note/reject/73036
Search -- https://master.php.net/manage/user-notes.php