Regular expression problem

Discussion in 'ASP General' started by Chris, Jul 5, 2006.

  1. Chris

    Chris Guest

    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.
    Chris, Jul 5, 2006
    #1
    1. Advertising

  2. Chris

    Evertjan. Guest

    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)
    Evertjan., Jul 5, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. godfather2

    Regular Expression problem

    godfather2, Jul 20, 2003, in forum: Perl
    Replies:
    1
    Views:
    990
    Shawn Corey
    Jul 20, 2003
  2. VSK
    Replies:
    2
    Views:
    2,261
  3. Nazir
    Replies:
    3
    Views:
    5,042
    jayendra gadhavi
    Jan 2, 2008
  4. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    822
    Alan Moore
    Dec 2, 2005
  5. GIMME
    Replies:
    3
    Views:
    11,909
    vforvikash
    Dec 29, 2008
Loading...

Share This Page