Now I've got another problem, and I don't have a clue what it is this time.
I'm trying to get info from a contacts PSM, using RegEx. I have for example
Xbox 360: Sonic The Hedgehog 2 (Stefan Leroux)
For this I'm using
JScript code:
var XBG = NewPsm.match(new RegExp("Xbox 360: (.*?) (" + X360GamerTag + ")", "i"))[1];
As far as I can figure, this should give me the game name, as it has a leading and ending space. It just gives me a null or not an object in debug.
Even stranger is I changed it to remove the space between (.*?) and (, and this works, buts gives me a result of "Sonic The Hedgehog 2 (", including the (, which should be regexed out.
I've also tried \escaping the ( and ), but that just gave me the same error as the first.
Anyone able to tell me what I'm doing wrong?
- Q2) Slightly off topic, but I didn't want to start a new post. How can I detect if an array has data? I have a variable being set to regex, so I'm looking to set reply[1], but if there is no match, it just breaks. I've tried if (reply[1]!==null) but it still gives me a debug of 'null' is null or not an object.