What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » how do i replace this text?

how do i replace this text?
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: how do i replace this text?
I'm very sorry for my mistake, though you still shouldn't need the \n in them at least because this is part of both \s and $.

quote:
Originally posted by TazDevil
code:
    words_wrong = new Array("teh", "tehn");
    words_right = new Array("the", "then");
    for(i = 0; i < words_wrong.length; i++)
    {
        message = message.replace(/(^|\s|\n)+ words_wrong[i] +($|\s|\n)/gi, "$1"+words_right[i]+"$2");
    }
    return message;


so what is wrong here? how can i add a variable in the regexp expression...

There is no way that I have fount to be able to have a variable in a regular expression, I don't think it is possible (though I could be wrong).
[Image: markee.png]
12-01-2006 05:08 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
how do i replace this text? - by roflmao456 on 11-21-2006 at 02:55 AM
RE: how do i replace this text? - by markee on 11-21-2006 at 02:59 AM
RE: how do i replace this text? - by roflmao456 on 11-21-2006 at 02:59 AM
RE: how do i replace this text? - by markee on 11-21-2006 at 03:12 AM
RE: RE: how do i replace this text? - by roflmao456 on 11-21-2006 at 03:25 AM
RE: how do i replace this text? - by markee on 11-21-2006 at 03:37 AM
RE: how do i replace this text? - by roflmao456 on 11-21-2006 at 04:14 AM
RE: how do i replace this text? - by TazDevil on 12-01-2006 at 04:08 PM
RE: how do i replace this text? - by Matti on 12-01-2006 at 04:16 PM
RE: RE: how do i replace this text? - by markee on 12-01-2006 at 04:25 PM
RE: how do i replace this text? - by TazDevil on 12-01-2006 at 04:23 PM
RE: how do i replace this text? - by TazDevil on 12-01-2006 at 04:31 PM
RE: how do i replace this text? - by Matti on 12-01-2006 at 04:33 PM
RE: how do i replace this text? - by TazDevil on 12-01-2006 at 04:52 PM
RE: how do i replace this text? - by markee on 12-01-2006 at 05:08 PM
RE: how do i replace this text? - by CookieRevised on 12-01-2006 at 09:02 PM
RE: how do i replace this text? - by TazDevil on 12-01-2006 at 09:44 PM


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