To be more thorough, perhaps:
^(https?://[^/]*)
Or further:
^((?:https?|mailto)://[^/]*)
You should also hope that your 'username' and 'password' do
not contain any slashes. The only restriction would appear
to be that the username cannot contain a ':', and the password
cannot contain an '@', though this could be browser dependent.