$new_url =~ s/\&/&/g; my $joined=join('|',qw(sessionid lsessionid jsessionid SID PHPSESSID SessionID BV_SessionID osCsid)); $new_url =~ s/[?&;](?:${$joined})=[^&;]+//ig;