regex to match a URL with optional 'www' and protocol
问题 I'm trying to write a regexp. some background info: I am try to see if the REQUEST_URI of my website's URL contains another URL. like these: http://mywebsite.com/ google.com/search=xyz However, the url wont always contain the 'http' or the 'www'. so the pattern should also match strings like: http://mywebsite.com/ yahoo.org/search=xyz http://mywebsite.com/ www.yahoo.org/search=xyz http://mywebsite.com/ msn.co.uk' http://mywebsite.com/ http://msn.co.uk' there are a bunch of regexps out there