Convert all occurrence of www
in string with http://www
I have tried
Regular expression: /^www(?!http\:\/\/|https\:\/\/)./g;
but it's working only in case when any character or digit don't precede www. For example: Find me at www.test.com
in this case it's failing but it's working for www.google.com find me on this
. I don't know how to put condition in regular exp for this.
function mailify(text)
{
var regEx = /^www(?!http\:\/\/|https\:\/\/)/g;
return text.replace(regEx, "http://www");
}
console.log(mailify("www.ni@gmail.com"));