title: Regsub not manipulating string from URL
body: <p>I am getting a strange TCL error when using this <code>iRule</code>, the error is:</p>
  <blockquote>
  <p>&lt;HTTP_REQUEST&gt; - ERR_ARG (line 2)     invoked from within &quot;HTTP::uri
  [regsub &quot;/3dnotification&quot; [HTTP::uri] &quot;&quot;] &quot;</p>
  </blockquote>
  <p>This is an F5 irule code.</p>
  <p>This what I have tried:</p>
  <pre><code>   when HTTP_REQUEST 
  { 
      if { not ( [string tolower [HTTP::uri]] starts_with &quot;/socket.io&quot; )} then { 
          HTTP::uri [regsub &quot;/3dnotification&quot; [HTTP::uri] &quot;&quot;] 
      
      # need to strip trailing slash on URI otherwise results in 404 for resources...
          HTTP::uri [regsub &quot;\/$&quot; [HTTP::uri] &quot;&quot;]
      } elseif { [string tolower [HTTP::header Upgrade]] contains &quot;websocket&quot; } {
          ONECONNECT::reuse disable
          set oc_reuse_disable 1
      }
      HTTP::header replace &quot;X-Forwarded-ContextPath&quot; &quot;/&quot;
  }
  when SERVER_CONNECTED {
      if { [info exists oc_reuse_disable] } {
          # Optional; unnecessary if the HTTP profile is disabled (goes into passthrough mode).
          ONECONNECT::detach disable
          unset oc_reuse_disable
      }
  }
  
  </code></pre>