If it is rather easy to extract anything that begins with "www", it's more difficult to tell where it ends, unless you hardcode all possible domain extensions .com,.org,.net....
Supporting only the two domain extensions .com and .net, the Regexp would be something like this :
.(www.[.com|.net]).*
and you can just extract the 1st capturing group.
Now a detail : how to do it in PHP 😃
taking your example
$mystring = "blablablawww.yahoo.comblabla";
$mypattern = ".*(ww.*[.com|.net]).*";
if (ereg($mypattern,$mystring,$regs)) {
echo "THe URL : ".$regs[1];
}
else {
echo "Pattern not found";
}
something like that (not tested).
hope it helps
EDIT : removed the 3rd "w" from the pattern to avoid automatic formatting.