note 73036 deleted from function.preg-match by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:14:23 +0000 |
| Subject: | note 73036 deleted from function.preg-match by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127578@lists.php.net to get a copy of this message | ||
Note Submitter: izua dot richard at gmail dot com
----
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.