Regular expression question?
- From: "Leon" <vnality@xxxxxxx>
- Date: Thu, 16 Jun 2005 16:33:18 -0500
My web application allow the user to enter the site by typing in a subdomain
such as 'name.domain.com'. However, I want to retrieve just the 'name' part
of the subdomain. see code below (the equal sign '=' respresent the value
I'm getting when I run the code)
Test 1.........................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink, "$1")) ---->> =
http://name.doman.com/welcome.aspx ---- this should = name
Test 2................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink,
"test/default.aspx?Id=$1")) ---->> = test/default.aspx?Id=name ---- this is
correct
.
- Follow-Ups:
- Re: Regular expression question?
- From: tom . pesterDeLeTeTHISSS
- Re: Regular expression question?
- Prev by Date: Re: grant application permissions on server host
- Next by Date: Re: ASP.Net client sending XML string to remote .net web service
- Previous by thread: RE: regular expression question?
- Next by thread: Re: Regular expression question?
- Index(es):
Relevant Pages
|