ASP.NET Regex Help Required

U

[UKLans]Khan

Guest
Hello guys,

What is the regex command for finding the text in a link. Ie:

href="www.then domain.com">

I need the: www.thedomain.com

so in this case between the "" but what happens if it has a " in the url. E.g:

href="www.thedomain.com/page.aspx?id="1"">

I need the: www.thedomain.com/page.aspx?id="1"

and what happens if the tag has more at the end. e.g:

href="www.thedomain.com/page.aspx?id="1"" class="theclass">

I need the: www.thedomain.com/page.aspx?id="1"

Thanks,

Khan
 
J

Jonty

Guest
Hi Khan

Unfortunately I'm not an expert in ASP.NET, however I can tell you now that any query string in a URL (i.e. mypage.aspx?someVar=1) will never contain double quotes (""), nor should they ever really include single quotes (''). This basically stems from the fact that a double quote will confuse the HTML parser which would think the href="" attribute ended at the second double quote it finds. Anyway, you just won't find any query strings with double quotes in, so that at least helps a little bit :) I'll have a look around for information on the regex function.

Kind Regards
 
J

Jonty

Guest
Now now, [UKLans]Khan asked for your help, so leave your opinions at the door :p
 
U

[UKLans]Khan

Guest
ta for the links i'll take a look. Oh and as for ASP.Net and bad opionions, I have to use it, my work servers only support microsoft scripting languages.

Ta

Khan
 

Users who are viewing this thread

Top Bottom