Responding to your question (What am I missing?), the regular expression you put in should find what you ask for.
You can check here .
I do not know if what you want to say is that you need to find the same thing but making the protocol (http / https / ...) optional.
In this case, you can achieve it by putting it in a group and making it optional with ?
. So ^(?:(http|ftp|https|www)://)?
This would work as well for google.com
and www.google.com
with nothing in front.
Anyway, validating a url by means of a regular expression can be more complicated than it seems, since it has many cases in which you have probably not thought about.
It is best to use a regular expression that is accepted as correct and widely tested.
In this post from SO in English some solutions are discussed. Even for C # there is a solution without using regular expressions.