Regular expression problem

C

Chris

I want to search a string of HTML and insert a querystring into any url
where the url is an asp page and is either a local link /folder/page.asp or
of a specific domain http://www.somedomain.com/folder/page.asp. It needs to
be able to handle plain links and those with querystrings already in there.
I could do it with instr functions etc but I thought this might a good time
to brush up on regular expressions. Can anyone point me in the right
dirction? Regards.
 
E

Evertjan.

Chris wrote on 05 jul 2006 in microsoft.public.inetserver.asp.general:
I want to search a string of HTML and insert a querystring into any
url where the url is an asp page and is either a local link
/folder/page.asp or of a specific domain
http://www.somedomain.com/folder/page.asp.

in ASP-Jscript:

myHTML = myHTML.replace(/(\.asp)/ig,"$1?q=Blah")
It needs to be able to
handle plain links and those with querystrings already in there. I
could do it with instr functions etc but I thought this might a good
time to brush up on regular expressions. Can anyone point me in the
right dirction? Regards.

You can expand this to any level of sophistication of your "need",
but I think you will have to do that yourself or find a programmer.

Show where you get stuck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top