preg guru again.....

From: Date: Mon, 23 Feb 2004 16:36:57 +0000
Subject: preg guru again.....
Groups: php.general 
Request: Send a blank email to php-general+get-178535@lists.php.net to get a copy of this message
Am trying to do a strange thing with php.. Extract the urls from the Internet Explorer index.dat history files (dont ask why!) Here is a snippet ð­ :2002020720020208:default@http://www.lyricsworld.com/cgi-bin/search.cgi?q=Bruce +Springsteen&m=phrase&ps=20&o=0&wm=wrd&ul=&wf=22221ð­ð­ð­ð­ it breaks down in the following elements the :date: in the format yyyymmddyyyymmdd The expression I'm using is (":16[0-9]:") ie matching the : with 16 digits : I'm using to match the url part (taken from php manual - thanks).. however am getting all the illegal characters - nulls, binary, etc back as its a binary file preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $contents, $match); also I want to allow / ~ ? & characters as well as http: file: protocols Complete string is preg_match(":16[0-9]:/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $contents, $match); Of course it doesnt work !!! any help would be appreciated Pete

« previous php.general (#178535) next »