I think he wants to strip the http bit when he puts it in the database or something so when he adds the http:// bit again it will be a proper link.
If someone types http//mywebsite.com id will end up as http://http//mywebsite.com.
<?php
$regex = '/([a-zA-Z:]+)\/{1,6}/'; // picked {1,6} /,////// can be 3 or 4 just as an example due to if we counting on people being wrong, might as well count on them being really wrong :)
$url = 'http://www.someurl.com/monkeys/index.htm';
preg_match( $regex , $url , $matches );
print_r($matches);
echo preg_replace( $regex ,"", $url ,1);
?>
due to there are two // the chances of one getting there is reasonably high.
Probably some ninja regex out there that would burn my eyes would be better but I am not that good with them.
Mine doesn't deal with
http//:www.someurl.com/monkeys/index.htm