quote:
Originally posted by CookieRevised
quote:
Originally posted by billboy1001
actually now that i did take the time to read, and with a few modifications my script is working perfectly now.
EDIT: how can i make a regular expression to split "hello world, hi" into "hello" and "world, hi" willcode:
RegExp(/^\s+(\S+)\s+(.+)$/i).exec(sMessage)
do it?
teaching regular expressions via a post here is way to difficult. I suggest you read up on some tutorials. And start by learning the syntax of regular expressions as used in JScript:
* MSDN: Regular Expression Syntax
* MSDN: Regular Expression Object
* some unofficial tutorial
* etc...
The proper code for what you want could be something like:code:
RegExp(/^(\S+)\s+(.+)$/i).exec(sMessage)
RegExp.$1 will be "hello"
RegExp.$2 will be "world, hi"
sweet, thank you
sorry bout the crap thing