How to make auto hyperlink regex ignore img tags with src? : <p>I have the following regex which replaces all plain-text hyperlinks into actual anchor tags.</p>

<pre><code>$acturl = '~(?:(https?)://([^\s&lt;]+)|(www\.[^\s&lt;]+?\.[^\s&lt;]+))(?&lt;![\.,:])~i'; 

$content = preg_replace($acturl, '&lt;a href="$0"&gt;$0&lt;/a&gt;', $content);
</code></pre>

<p>However, the problem with this code is that it also converts img tags into anchors too.</p>

<p>For example,
<code>&lt;img src="https://link.com"&gt;</code> will become <code>&lt;img src="&lt;a href='https://link.com'&gt;https://link.com&lt;/a&gt;"&gt;</code>.</p>

<p>Is there a way to have this regex ignore images and only operate on plain-text URLs?</p>
