Matchtext to find a series of words

Ken Ray kray at
Wed Nov 29 17:08:30 EST 2006

On 11/29/06 3:26 PM, "J. Landman Gay" <jacque at> wrote:

> I need a matchtext/regex that will find a series of words in a block of
> text, no matter whether they are together or not, and ignoring carriage
> returns. For example:
> See if all of these words: dog cat dinosaur
> are in this text:
> "The purple dinosaur inadvertently stepped on the cat.<cr>
> The white dog howled."
> Should return true. Is there such a thing?

Well, you can do this, but there may be a more efficient way:

  put (matchText(tText,"(?si)\bdog\b") and \
    matchText(tText,"(?si)\bcat\b") and

If I keep trying, maybe I can come up with a more efficient one-liner...

Ken Ray
Sons of Thunder Software, Inc.
Web site:
Email: kray at

More information about the Use-livecode mailing list