https:://site.ru
или http://en.site.ru
https://site.ru
http://site.ru
http://site.xyz/bla
https://site.com/blabla/test
https://en.site.com/blabla/test
site.ru/blabla/test/test2
<script>
var s_ar=new Array (
"https://site.ru",
"http://site.ru",
"http://site.xyz/bla",
"https://site.com/blabla/test",
"https://en.site.com/blabla/test",
"site.ru/blabla/test/test2"
);
var x_ar=new Array ();
var i, l=s_ar.length;
var r="";
for (i=0; i<l; i++)
{
x_ar=s_ar [i].split(/\//);
if (s_ar [i].indexOf ("://")!=-1)
r+=x_ar [0]+"/"+x_ar [1]+"/"+x_ar [2]+"\n";
else
r+=x_ar [0]+"\n";
}
alert (r);
</script>