On 2/28/05 2:51 PM, "Alex Tweedly" <[EMAIL PROTECTED]> wrote:

> RegEx allows the "unix-style" (or C-style, or Perl-style) quoting of
> special characters, so "\s" means "(space)"  - so the two versions of
> "\s+" and " +" are effectively the same - choose whichever you find
> easier to read.

No to be pedantic, but just to clarify:

  \s means "any whitespace character", which can be a space, a tab,  a
carriage return, a linefeed or a formfeed.

However for this purpose, Alex is right - the two are effectively the same.
The only time you'd want to choose one over the other is if you cared to
deal with different kinds of whitespace in the same string. So:

  put "Ken" & linefeed & "Alex  Frederic" & CR & "James" into tText

  put replaceText(tText," +",tab)
  --> Ken <linefeed> Alex <tab> Frederic <CR> James

  put replaceText(tText,"\s+",tab)
  --> Ken <tab> Alex <tab> Frederic <tab> James

Hope this helps,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]


_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to