Validate URL with or without protocol

Hi I would like to validate this following urls, so they all would pass with or without http/www part in them as long as there is TLD present like .com, .net, .org etc..

Valid URLs Should Be:

Also maybe allow even IPs:

(but this is extra!)

Also allow dashes (-), forgot to mantion that =)

I’ve found many functions that validate one or another but not both at same time.
If any one knows good regex for it, please share. Thank you for your help.

Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.