> [snip]
> I receive posts from an open moderated forum that need to be filtered
> for urls. I've successfully managed to trap any entires that use 
> 'http://' 'www.' with the standard '.com' '.org', '.net' endings.
>
> What I need to do is to strip the prefix part ('http:// or http://www.
> or 'www') and suffix as well (the .com, etc.) I need only the domain 
> name.
> I can't seem to trim away the suffix part.
> [/snip]

What I've done in situations like this is reverse the text and tackle it 
from the _back_ end.  It's a simpler approach to first trim off the TLD, 
and then to extract only the (reversed) domain name.  (Tho', it's not a 
domain name without the TLD.)
Then, obviously, reverse your results.

HTH
Jonesy
-- 
  Marvin L Jones    | jonz          | W3DHJ  | linux
   38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
    *** Killfiling google posts: <http://jonz.net/ng.htm>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to