Valhalla Legends Forums Archive | Web Development | Javascript Question

QwertyMonsterOkay 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?


Code: [Select]
        var i, usrsArr = usrs.split("|");
        for(i = 0; i < usrsArr.length;i++)

EDIT: And yes, it's been a long time since I posted.  :)
January 26, 2009, 11:46 AM
xpehThis is regexp, dude.

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

google://regular expression

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

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