More regex madness

Bob Sneidar bobs at twft.com
Thu Mar 17 12:10:32 EDT 2011


Hey! Right you are! The error was caused by a beginning asterisk and there was no preceding character. Ya know, what these so called regex primers need more than anything else is some good examples. Almost none of them have examples. Once I saw your example, it was clear as glass. Maybe you need to write up a regex primer! ;-)

Bob


On Mar 16, 2011, at 7:09 PM, Mike Bonner wrote:

> the * matches any number of chars matching the preceeding char.
> so *varchar*will try to match varcharrrrrrr
> To do what you want, use the period which stand for any char.
> 
> So.. ".*varchar.*default.*" might be closer to what you want. Can be some
> weird results depending on whats in the string that is being regexed, but
> should get you a start.
> 
> On Wed, Mar 16, 2011 at 6:20 PM, Bob Sneidar <bobs at twft.com> wrote:
> 
>> Hi all.
>> 
>> I read over the regex specifications, and I am more confused than ever. I
>> want to find, say any text and "varchar" and any text and "default" and any
>> text. I would think that:
>> 
>> matchText("varchar(255) default `Yes`", "*varchar*default*") would return
>> true, but no. I get:
>> 
>> Message execution error:
>> Error description: matchChunk: error in pattern expression
>> Hint: bad escape sequence
>> 
>> However:
>> 
>> put matchText("varchar(255) default `Yes`", "varchar")
>> 
>> returns true.
>> 
>> How do I use wild cards?? I really thought I understood at least the basics
>> of regex, but I see I do not.
>> 
>> Bob
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list