if($new_url =~ m/([?&;](?:sid|session_id)=[^&;]+)/i){ $new_url =~ s/\Q$1\E//g; }