What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help]Returning the inside of a string...

[Help]Returning the inside of a string...
Author: Message:
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: [Help]Returning the inside of a string...
quote:
Originally posted by Pai
That would be correct if we were using PHP (preg), but doesn't apply to JScript ... text only contains a string with the matched expression (moo in this case), and not an array with the matches (Smilie)
it does return captured text ( stuff within () ) if you dont use the G modifier which is something I forgot about in my example


eg javascript shell output

code:

//first test
"[b]moo[/b][b]aaa[/b]".match(/\[b\](.*?)\[\/b\]/);
-> [b]moo[/b],moo


//with G
"[b]moo[/b][b]aaa[/b]".match(/\[b\](.*?)\[\/b\]/g);
-> [b]moo[/b],[b]aaa[/b]



This post was edited on 07-13-2006 at 10:07 AM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-13-2006 10:07 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Help]Returning the inside of a string... - by andrewdodd13 on 07-12-2006 at 05:11 PM
RE: [Help]Returning the inside of a string... - by Pai on 07-12-2006 at 06:01 PM
RE: [Help]Returning the inside of a string... - by -dt- on 07-13-2006 at 03:13 AM
RE: RE: [Help]Returning the inside of a string... - by Pai on 07-13-2006 at 08:32 AM
RE: [Help]Returning the inside of a string... - by Silentdragon on 07-13-2006 at 09:56 AM
RE: [Help]Returning the inside of a string... - by -dt- on 07-13-2006 at 10:07 AM
RE: [Help]Returning the inside of a string... - by Pai on 07-13-2006 at 11:21 AM
RE: [Help]Returning the inside of a string... - by andrewdodd13 on 07-13-2006 at 11:33 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