Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I use Regex to parse the querystring

Posted on 2006-11-15
3
Medium Priority
?
182 Views
Last Modified: 2010-04-16
I know that I can just use Request.QueryString("Page") to get the value "Home"
How can I use Regex to parse the querystring and get the Page Value.

string url = "http://67.59.187.45/events_view.aspx?EventID=322&Page=Home&Bla=Bla"

I want to use regex to parse the url string to get the result:
"Home"
0
Comment
Question by:quest_capital
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 2000 total points
ID: 17954393
string s = "http://67.59.187.45/events_view.aspx?EventID=322&Page=Home&Bla=Bla";
                  Regex r = new Regex("Page=([^&]*)");
                  Match m = r.Match(s);
                  Console.WriteLine(m.Groups[1].Value);
                  Console.ReadLine();
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question