[?] "Dynamic" RegExp replace... - 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: [?] "Dynamic" RegExp replace... (/showthread.php?tid=98162) [?] "Dynamic" RegExp replace... by whiz on 08-16-2011 at 05:57 PM
Not sure on the best way to go about this... jscript code:...but I just get undefined from the RegExp. Is there a way of doing this? RE: [?] "Dynamic" RegExp replace... by Eljay on 08-16-2011 at 06:19 PM
Don't think you can do it in one replace call, you can always just loop through them: js code: RE: [?] "Dynamic" RegExp replace... by whiz on 08-16-2011 at 06:54 PM Hmm, didn't think of that. Works a treat, thanks! RE: [?] "Dynamic" RegExp replace... by Matti on 08-17-2011 at 02:22 PM
The reason why your version won't work is because regexp.$1 is evaluated once when that line is run. js code: RE: [?] "Dynamic" RegExp replace... by whiz on 08-17-2011 at 06:20 PM Looks like I could do some more advanced stuff with that... might be easier to implement stuff later on. Thanks for that! |