Unrelated, and this happens because your regex is wrong. You probably want to do something along this in the regsub (your substitution has to substitute everything you want to change, and then reinsert the captures that should stay):<div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">ban("req.url ~ "+regsuball(req.url, "code=cotn:([^&]+).*$",".*\1.*")</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">);</span></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">Reclosing.</font></div><div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">Regards,</font></div>
<div><font color="#222222" face="arial, sans-serif">Martin Blix Grydeland<br></font><br><div class="gmail_quote">On Thu, Jan 17, 2013 at 6:43 PM, Varnish <span dir="ltr"><<a href="mailto:varnish-bugs@varnish-cache.org" target="_blank">varnish-bugs@varnish-cache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">#1249: Undeterministic results in regsub/regsuball<br>
</div>---------------------+-----------------------<br>
 Reporter:  arthens  |       Owner:<br>
     Type:  defect   |      Status:  reopened<br>
<div class="im"> Priority:  normal   |   Milestone:<br>
Component:  build    |     Version:  3.0.3<br>
</div> Severity:  normal   |  Resolution:<br>
 Keywords:           |<br>
---------------------+-----------------------<br>
Changes (by tohide):<br>
<br>
 * status:  closed => reopened<br>
 * resolution:  invalid =><br>
<br>
<br>
Comment:<br>
<br>
 Apologies, reopening.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ticket URL: <<a href="https://www.varnish-cache.org/trac/ticket/1249#comment:8" target="_blank">https://www.varnish-cache.org/trac/ticket/1249#comment:8</a>><br>
</font></span><div class="HOEnZb"><div class="h5">Varnish <<a href="https://varnish-cache.org/" target="_blank">https://varnish-cache.org/</a>><br>
The Varnish HTTP Accelerator<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><table border="0" cellpadding="0" cellspacing="0" style="font-size:12px;line-height:1.5em;font-family:'Helvetica Neue',Arial,sans-serif;color:rgb(102,102,102);width:550px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(238,238,238);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);margin-top:20px;padding-top:5px;padding-bottom:5px">
<tbody><tr><td width="100"><a href="http://varnish-software.com" target="_blank"><img src="http://www.varnish-software.com/static/media/logo-email.png"></a><span></span><span></span></td><td><strong style="font-size:14px;color:rgb(34,34,34)">Martin Blix Grydeland</strong><br>
Senior Developer | Varnish Software AS<br>Cell: +47 21 98 92 60<br><span style="font-weight:bold">We Make Websites Fly!</span></td></tr></tbody></table></div>
</div>