I’m trying to match the the URI / URL scheme (e.x. ftp, http, https) using this regex ^(.*:) . The problem is that my url has a port number so the : to connote server connection in the scheme isn’t the only one in the URL there is also :80. How do I just match the scheme using regex?
Given this example:
http://video.google.co.uk/videoplay?docid=-7246927612831078230&hl=en#00h02m30s
I would like regex to just match:
http
I’m not interested in something like
^((http[s]?|ftp):\/)
I know this would work it, it is limiting however. It wouldn’t give me mailto, tel, ssh, etc.
I just found that
^[^:]+works.