stevegray
4Penny.net
Points: 55409

8/17/2014 10:15:12 PM

Regex - match part of a URL querystring

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

I struggle mightily with Regex, so every time that I achieve something I blog it.

Today, I wanted to look into the URL of a web site and remove part of the query string. Specifically, in these cases:

www.mysite.com?userid=123xy

www.mysite.com?userid=123xy&username=joe

www.mysite.com?tag=xyz&userid=1ww45

www.mysite.com?tag=xyz&userid=1g3x5&username=joe

I wanted to remove the 'userid=xxxxx' out of the url.

4Penny.net
Version: Unknown or N/A
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3