It looks like you are trying to build a URI regex. I can link a good-enough version here (I don't use this one but it might work for you):
/^(?:(\w[\w\d+.-]+):\/\/)?(?:(.+?):(.+)@)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[^#:\/\?\s]+)(?::(\d+))?\/?(\/(?:[^#\/\?\s]+\/)*[^#\/\?\s]+\/?)?(?:\?((?:[^#=\/\s]+=[^&;#\/\s]+[&;]?)+))?(?:#(.+))?$/g
http://regexr.com/3cmin
But I suggest you have a look at these
https://mathiasbynens.be/demo/url-regex
http://jmrware.com/articles/2009/uri_regexp/URI_regex.html
Regular expression to match generic URL
The official standard for URIs is RFC-3986
Otherwise just use regexr.com to debug your regex and regex101.com to explore it.
As was mentioned above you did not escape the . after www. Also your regex is infinite because it can match zero characters. You need to put a $ at the end at least to indicate end of match. And you are turning your regex into a lookahead right off the bat.