I have this regex code
/^(https?:\/\/+[\w\-]+\.[\w\-]+)/i
It works for full URLs, but you NEED http:// in the url for it to validate.
I am seeking a way to validate a URL where the protocol is optional.
The user won't want to add http:// to the URL, they want to just have example.com.
If it's possible, I need it to work whether it has http:// or not.
How do I do this?