easy regex question: stops on some white space?

Eric C eric-yrHdaQSNc4gdnm+yROfE0A at public.gmane.org
Tue Jun 12 15:08:00 EDT 2007


my problem is solved, mu ha ha ha ha haaaa!  again
many thanks to tom.

how kiddy code eric extracts info and transforms it:

// process uploaded .torrent. extract announce & hash
$handle = fopen($userfile, "r");
$hash = fread($handle, 30000);
$prehash = $hash; // tom said to check this!
preg_match("/info.*/s", $hash, $hash); // info subset
$hash = implode($hash);  // this feels stupid
$hash = ltrim($hash, "info");
$posthash = $hash;  // did regex work?
$hash = rawurlencode(mhash(MHASH_SHA1, $hash)); //
info %nn encoded

thanks again for the help blu!

- eric c.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.






More information about the Discuss mailing list