What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Regex with Variables

Regex with Variables
Author: Message:
ArkaneArkade
Full Member
***

Avatar
The One and Only

Posts: 193
Reputation: 5
38 / Male / Flag
Joined: Mar 2007
O.P. RE: Regex with Variables
Now I've got another problem, and I don't have a clue what it is this time.  :S

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.

This post was edited on 11-21-2008 at 07:51 AM by ArkaneArkade.
[Image: adsig.jpg]
11-21-2008 07:08 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Regex with Variables - by ArkaneArkade on 11-19-2008 at 06:05 AM
RE: Regex with Variables - by Mnjul on 11-19-2008 at 10:32 AM
RE: Regex with Variables - by ArkaneArkade on 11-19-2008 at 12:26 PM
RE: Regex with Variables - by ArkaneArkade on 11-19-2008 at 11:36 PM
RE: Regex with Variables - by andrewdodd13 on 11-20-2008 at 08:29 AM
RE: Regex with Variables - by ArkaneArkade on 11-20-2008 at 04:13 PM
RE: Regex with Variables - by ArkaneArkade on 11-21-2008 at 07:08 AM
RE: Regex with Variables - by Matti on 11-21-2008 at 04:41 PM
RE: Regex with Variables - by ArkaneArkade on 11-22-2008 at 11:51 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On