Home All Groups Group Topic Archive Search About

Regular expression problem



Author
5 Jul 2006 6:42 PM
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.

Author
5 Jul 2006 7:59 PM
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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

AddThis Social Bookmark Button