RegExp help/Alternative? - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: RegExp help/Alternative? (/showthread.php?tid=88328) RegExp help/Alternative? by ArkaneArkade on 01-12-2009 at 02:39 AM
Hey guys, as always, stuck again. code: code: Both of these strings are taken from different Media strings by different (yet default MS) apps. Both of them have different numbers of dividers (the "\0") and I think this is where my problems are occurring. I was trying to use a function to retrive the information, but because I'm unsure how to make each section optional I can't get it to retrieve the final sections without stopping it working. Lastly (I know, taking liberties now) I'd like to know if there is a way to return multiple values, so that I could set up the function to get the information I need For example, after running the RegExp, is there a way to return $1, $2, $3, falling back onto $1, $2 if there is no $3 (etc all the way up to the 10 or whatever the value is). The on the other end, to get just the one I want from the function (ie if the function is RunReg(), to do something such as "var variable = RunReg(2) to retrieve the second value? can anyone help me with any of this? I would be extremely grateful... Cheers guys Leroux RE: RegExp help/Alternative? by Spunky on 01-12-2009 at 03:00 AM
You can return an array... js code: EDIT: Also. If you put the media message in a string: js code: RE: RE: RegExp help/Alternative? by ArkaneArkade on 01-12-2009 at 03:32 AM
Thanks you Spunky. I never considered doing it that way, but because of that quick reply, I have it all sorted now quote:To work properly, needs to be js code: Cheers man RE: RegExp help/Alternative? by Spunky on 01-12-2009 at 03:44 AM
quote: You knew what I meant though And np. |