I have spent considerable amount of time searching for the solution or trying one, But I did not found one. So my usecase is:
I have a text which can have simple url(with or without http/s) or it can also have hyperlinked url.
What regex should do
It should leave hyperlink url as it is and convert the non hyperlinked url to a hyperlinked URL.
Example Text
I am learning regex from www.codeburst.com and trying regex at <a href="https://regexr.com">Regexr</a>
.
Expected Solution
I am learning regex from <a href="www.codeburst.com">www.codeburst.com</a>
and trying regex at <a href="https://regexr.com">Regexr</a>
.
I have tried
this regex, but it it not working as expected.
/((?!href).((https?:\/\/)||(www\.)|(mailto:)).+)/gi