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

Replacing "?"
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Replacing "?"
What I did was fixing Ezra's given solution, I did not take the actual suggestion in account, and maybe that was a mistake from my side. Sorry for that.

Well, in that case the regular expression becomes more complicated:
code:
stringObj.replace(/\w\?(\s|$)/, "..?$1");
This example will replace all "?" with "..?" when they are preceded by an alphanumeric character (a-z, A-Z and 0-9) and followed by a white space character (new line, tab, space,...) OR the end of the string. Therefore, it's somewhat limited because it won't parse something like "Hello!?", but if you really need that too this can be fixed by using:
code:
stringObj.replace(/\w([!\?]+)(\s|$)/, "..$1$2");
but then, it'll also change "Hello!" into "Hello..!" and maybe you don't want that. To avoid that from happening, you'll need to go even further, but I'm not in the mood to do that now. :P

This post was edited on 05-04-2007 at 04:41 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-04-2007 04:40 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Replacing "?" - by Jimbo on 05-03-2007 at 04:43 PM
RE: Replacing "?" - by Ezra on 05-03-2007 at 05:01 PM
RE: Replacing "?" - by Jimbo on 05-03-2007 at 06:01 PM
RE: Replacing "?" - by Matti on 05-03-2007 at 06:28 PM
RE: Replacing "?" - by Ezra on 05-03-2007 at 07:02 PM
RE: Replacing "?" - by CookieRevised on 05-03-2007 at 10:50 PM
RE: RE: Replacing "?" - by deAd on 05-03-2007 at 10:57 PM
RE: Replacing "?" - by CookieRevised on 05-03-2007 at 11:01 PM
RE: Replacing "?" - by Matti on 05-04-2007 at 04:40 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