[ad_1]
I have this regex where as you can see www.
is optional
(https:\/\/)(?:www\.)?([^\.\/][\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])
But this regex would match
https://w.youtube.com
or
https://w...youtube.com
for example, because it would think that w.
is a part of another group. But I want to prevent matching ww.
or w.
or w...
. It should be www.
or nothing at all.
[ad_2]