Scripting and regex

Discussion in 'Server and Client Scripting' started by Tickle, Jun 9, 2010.

  1. Tickle

    Tickle New Member

    Joined:
    May 17, 2010
    Messages:
    24
    Likes Received:
    0
    I'm trying to use regex, but it can't seem to parse correctly.
    code:
    Code (text):
    1.  
    2. mess = mess.replace(/fallout 3/gi,”Oblivion with guns”);
    3. mess = mess.replace(/pokemon/gi,”Pokémon”);
    4. sys.sendAll(sys.name(src) + ": " + mess);
    5. sys.stopEvent();
    6. this.afterChatMessage(src, mess);
    7.  
    can anyone tell me what I'm doing wrong?

    I can use mess.split instead, but it's just so inefficient combining all the strings many times.
     
  2. Lutra

    Lutra All Gen Battler/Scripter

    Joined:
    Apr 25, 2010
    Messages:
    509
    Likes Received:
    188
    PO Trainer Name:
    Lutra
    I get an error when I copied that because of the quotation marks you used. These work : " "
     
    Last edited: Jun 9, 2010
  3. Akusu

    Akusu Guest

  4. Tickle

    Tickle New Member

    Joined:
    May 17, 2010
    Messages:
    24
    Likes Received:
    0
    *facepalm*
    ok, that was simple. Thanks alot.