There is question by the almost the same name already: What is the best regular expression to check if a string is a valid URL
I don\'t understand this stackoverflow
After reading RFC 3986, I have to say I was wrong. That regexp is fully working (that I know). First mistake I had was syntax of IPv6 addresesses, they are put around [], and second was about example.org: (note trailing double dot :). But as the RFC says scheme can have dots in it, so it's also valid.
So that's valid RFC way to do it, but people will usually (as I will) need to modify it to only accept some schemas.