Here is the structure of a URL:
This regex stracts most elemnts of a URL including scheme, user, subdomain, domain, tld, path, query, and fragmentation. It still needs some improvements because the 3rd group (sibdomain, domain, tld) is not working perfectly.
(?i)(http[s]?:\/\/)?(?i)([0-9a-z-]*@)?(([0-9a-z-]+\.)*([0-9a-z-]{1,256})+(\.[0-9a-z-]{2,})+){1}(:\d*)*([\/|?]+[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)*
results can be found here.
^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
or
^(?:\d{1,3}\.){3}\d{1,3}$
^([0-9a-fA-F]){1,4}(:([0-9a-fA-F]){1,4}){7}$