Regular expressions - detecting whitespace

Steve Gehlbach steve at nexpath.com
Wed Aug 13 16:55:01 EDT 2003


Jim Witte wrote:
>
>   BTW, if I execute 'put matchText( "this text" , "(g*)")', it returns 
> true.  Certainly this is not a string of 'g's..  What am I doing wrong here

In RegExp, "*" matches _zero_ or more of the previous chars. What you 
want here is "(g+)" for one or more g's.  Kind of counter intuitive 
since for ls or dir, the "*" has a slightly different meaning, ie, "ls 
g*" will get all files starting with "g".  Not so in regexp.

Reg exp takes some getting used to.  I learned from Larry Wall's Perl 
book, that seems to be the best reference with examples, and more 
complete than the Rev Docs.

-Steve




More information about the use-livecode mailing list