note 27106 deleted from function.preg-replace by sniper

From: Date: Sun, 07 Sep 2003 22:04:32 +0000
Subject: note 27106 deleted from function.preg-replace by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55696@lists.php.net to get a copy of this message
Note Submitter: pedram@redhive.com ---- perhaps i'm missing something here, but one thing that i am certain of is that the regex's listed on this page are all missing the full URL's. for example: - http://www.example.com/~meow/file.html - http://www.example.com/?var=val in both the above cases the URL is chopped after ".com/" the simple regex i use to generate hyperlinks out of flat text is: $text = preg_replace("/(http.*:\/\/.+)\s/U", "<a href=\"$1\">$1</a>", $text); -pedram http://pedram.redhive.com

« previous php.notes (#55696) next »