What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [split] VBScript & pig latin

[split] VBScript & pig latin
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: VBScript & coding tips
First of all, you forgot to set the Globel property to true. This is needed if you want to repeat the replacement for all finds and not just the first one:

   regEx.Global = True

But both your pattern and replace strings are wrong though.
It should be something like this:

   MsgBox (ReplaceTest("\b(\w)(\w+?)(\w)\b", "$3$2$1"))

See the description of the regular expression pattern property for VBScript:
http://www.msgpluslive.net/scripts/view/152-Windo...ipt-Documentation/


But note that it will not work properly if your words begin or end with other letters than the standard ones or with accents and stuff, eg: ö ô é, etc

-------

Also note that always replacing the first and last letter and adding "ay" isn't pig-latin.
Also the example shown by Jarrod isn't pig latin. Although it comes very close. There are more rules than just swapping the letters and adding "ay" ;)

@Jarrod: Python works completely different and isn't going to help with VBScript in this case.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-04-2008 09:43 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
RE: VBScript & coding tips - by theimmortal_7 on 10-04-2008 at 03:11 AM
RE: VBScript & coding tips - by Jarrod on 10-04-2008 at 05:14 AM
RE: VBScript & coding tips - by CookieRevised on 10-04-2008 at 09:43 AM
RE: VBScript & coding tips - by Jarrod on 10-04-2008 at 09:55 AM
RE: VBScript & coding tips - by CookieRevised on 10-04-2008 at 10:11 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