Regular expressions

DunbarX at aol.com DunbarX at aol.com
Thu Feb 5 16:18:51 EST 2009


In a message dated 2/5/09 4:08:48 PM, briany at qldlearning.com writes:


> 
> Read it as "one 'Z' followed by zero or more 'A' followed by one 'B'". 
> Thus the Z and B are required with any number of A in between 
> (including zero). So it would match:
> 
> ZB
> ZAB
> ZAAB
> ZAAAB
> 
> And so on.
> 
> In short, a single letter matches just that - a single letter. The * 
> and + operators change the meaning to "zero or more" and "one or more" 
> respectively. If you want the operator to apply to an entire 
> expression, you need to group the expression in parentheses (or 
> brackets, but that has another meaning).
> 
> I think you may have a typo in your question, since both of your 
> examples have the same expression - but hopefully that helps.
> 

Thanks, I see it now, What threw me was the word "pattern" which made me 
think of the "Z", the "A", or the "ZA". I see now it is only the single preceding 
char (or pattern), and the "Z" is just there for reference.

And yes, I should have had a "+" in the second example.

Obvious.

Craig Newman


**************
Great Deals on Dell Laptops. Starting at $499. 
(http://pr.atwola.com/promoclk/100000075x1217883258x1201191827/aol?redir=http://ad.
doubleclick.net/clk;211531132;33070124;e)



More information about the use-livecode mailing list