Regex

Discussion in 'Javascript' started by Phat G5 (G3), Apr 22, 2006.

  1. Phat G5 (G3)

    Phat G5 (G3) Guest

    Trying RegExp and having troubles. I need to remove specific items from a
    link. I wrote this

    var re = new RegExp('/&bulk=' + ckBox.value + '*/gi');
    if( document.getElementById("next1") )
    document.getElementById("next1").href.replace(re ,'');
    if( document.getElementById("prev1") )
    document.getElementById("prev1").href.replace(re ,'');


    I just cant get it to replace the &bulk=number correctly...

    Any advice appreciated!

    -S
    Phat G5 (G3), Apr 22, 2006
    #1
    1. Advertising

  2. Phat G5 (G3)

    Phat G5 (G3) Guest

    in article C06FE21E.35BE2%, Phat G5 (G3) at
    wrote on 4/22/06 1:37 PM:

    > Trying RegExp and having troubles. I need to remove specific items from a
    > link. I wrote this
    >
    > var re = new RegExp('/&bulk=' + ckBox.value + '*/gi');
    > if( document.getElementById("next1") )
    > document.getElementById("next1").href.replace(re ,'');
    > if( document.getElementById("prev1") )
    > document.getElementById("prev1").href.replace(re ,'');
    >
    >
    > I just cant get it to replace the &bulk=number correctly...
    >
    > Any advice appreciated!
    >
    > -S
    >

    Ok, stupid me... I made this mistake before. I needed to do a

    str= str.replace...


    Thanks

    -S
    Phat G5 (G3), Apr 22, 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. =?Utf-8?B?SmViQnVzaGVsbA==?=

    Is ASP Validator Regex Engine Same As VS2003 Find Regex Engine?

    =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    699
    =?Utf-8?B?SmViQnVzaGVsbA==?=
    Oct 22, 2005
  2. Rick Venter

    perl regex to java regex

    Rick Venter, Oct 29, 2003, in forum: Java
    Replies:
    5
    Views:
    1,622
    Ant...
    Nov 6, 2003
  3. Replies:
    2
    Views:
    597
  4. Xah Lee
    Replies:
    1
    Views:
    940
    Ilias Lazaridis
    Sep 22, 2006
  5. Replies:
    3
    Views:
    760
    Reedick, Andrew
    Jul 1, 2008
Loading...

Share This Page