I want to detect urls in a text and i have achieved that using the following regex
const urlRegex = /(https?:\/\/[^\s]+)/g;
This detects the urls when starting with https
or http
. But i want to detect a url starting with www
as well. How can i modify this regex to detect urls starting with www
also?