note 71037 added to function.preg-match-all

From: Date: Thu, 09 Nov 2006 11:01:57 +0000
Subject: note 71037 added to function.preg-match-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-119542@lists.php.net to get a copy of this message
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 />"; } ---- Server IP: 192.35.244.50 Probable Submitter: 80.109.180.63 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php Edit -- https://master.php.net/note/edit/71037 Del: integrated -- https://master.php.net/note/delete/71037/integrated Del: useless -- https://master.php.net/note/delete/71037/useless Del: bad code -- https://master.php.net/note/delete/71037/bad+code Del: spam -- https://master.php.net/note/delete/71037/spam Del: non-english -- https://master.php.net/note/delete/71037/non-english Del: in docs -- https://master.php.net/note/delete/71037/in+docs Del: other reasons-- https://master.php.net/note/delete/71037 Reject -- https://master.php.net/note/reject/71037 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#119542) next »