note 71037 deleted from function.preg-match-all by nlopess

From: Date: Thu, 09 Nov 2006 14:14:03 +0000
Subject: note 71037 deleted from function.preg-match-all by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-119549@lists.php.net to get a copy of this message
Note Submitter: giuseppe at zeroeuro dot it ---- This regular expression (in 3 lines,otherwise too long for layout) will match all internet adresses with or without http:// included every subdirectory. (ex. http://www.ciccio.com/sub/sub2/sub3/index.php) $mod="^(http\://)*(www)+[\w\-\.]+\.[a-zA-Z]{2,} (/?[\w\-\.\_\?\=]*)* (/?[\w\-\.\_\?\=]+/?[\w\-\.\_]+)*^"; $ric = file_get_contents("http://www.ciccio.com"); $ind=preg_match_all($mod, $ric, $ris); for($i=0;$i<$ind;$i++){ print $ris[0][$i]."<br />"; }

« previous php.notes (#119549) next »