Valhalla Legends Forums Archive | Web Development | Javascript Question

AuthorMessageTime
QwertyMonster
Okay so i'm trying to work out what this javascript regex function does, and I really can't work it out. Can someone help me? I know it splits usernames into "username|username" and so on. I also know (I think) /g means it will encrypt all usernames, or in this case replace them with something.

I have no idea what the /\% does though. Can someone help me with this?

Thanks.

[code]        var i, usrsArr = usrs.split("|");
        for(i = 0; i < usrsArr.length;i++)
            $atf("atf_"+usrsArr[i].replace(/\%/g,""));
    }[/code]

EDIT: And yes, it's been a long time since I posted.  :)
January 26, 2009, 5:46 PM
xpeh
This is regexp, dude.

"//" are borders, and "\%" is escaped "%"

google://regular expression

btw, usrs.split("|");
| imo must be escaped
usrs.split("\|");

+rep me :)
January 26, 2009, 9:34 PM

Search