I'm looking for a way to modify this function, which I found here, so that it doesn't change the tags I already have.
function make_links_clickable($text){
return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1">$1</a>', $text);}
For example, while it works great at turning regular text into links, it also turns this:
<a href="https://stackoverflow.com/">stackoverflow</a>
Into this:
https://stackoverflow.com/">stackoverflow
As I'm a beginner, and not very familiar with regexp, I'd appreciate it if there was a simple solution to this that doesn't require making the code a lot more complicated than it already is.