I have text which contains URLS starting with http, https and www. for example,
text = "I want to open up www.google.com"
How can I convert www.google.com
to its corresponding URL link in the same text?
I looked at https://gist.github.com/guillaumepiot/4539986. The # Replace url to link
example works perfectly for URLS starting with http
and https
. How can I modify the regular expression in this example to work for URLs starting with www
. Also, how will the corresponding HTML
change?
I found many similar questions on the Internet but none of the answers to those questions worked for my case.