
I spent a while looking for something that would remove URLs from some text. The only thing I managed to find was one that would remove only complete URLs e.g. http://www.themediadudes.com. As nobody writes like that when spamming and this was going to be used on something that anyone can write in, I needed something better.
I made my own thing and I'm sharing it with you so you dont have to search, find nothing, then make your own like I did.
$text = preg_replace("/(^|\s)(http:\/\/)?(www\.)?[0-9a-zA-Z\-_~]+\.(com|net|org|info|name|biz|.+\.\w\w)((\/)?[0-9a-zA-Z\.\-_~#]+)?\b/ie","",$text);
My regular expression skills are teh sux, so you can probably tweak that a lot.