Matchtext for multiple words

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Nov 29 17:44:34 EST 2006


I was a bit fast: probably will you have to complicate this a bit to  
take into account words at the beginning or the end of a line and all  
punctuation marks:
Then I understand better your concern about a regex ;-)

Le 29 nov. 06 à 23:19, Eric Chatonet a écrit :

> Hi Jacque,
>
> Are you sure you need a regex? ;-)
>
> function AreWordsIn pText,pWords
>   repeat for each word tWord in pWords
>     if space & tWord & space is not in pText then return false
>   end repeat
>   return true
> end AreWordsIn
>
> As this way of doing searches for words that are not in the text,  
> it should be very fast...
>
> Le 29 nov. 06 à 22:39, J. Landman Gay a écrit :
>
>> Sorry if this comes through twice, I'm having trouble sending to  
>> the list.
>>
>> I need a matchtext/regex that will tell me if all supplied words  
>> exist in a block of text, regardless of their order, and ignoring  
>> carriage returns.
>>
>> For example, see if all these words:  dog dinosaur cat
>>
>> exist in this text:
>>
>> "The purple dinosaur inadvertently stepped on the cat.<cr>
>> The white dog howled."
>>
>> Should return true. Is there such a thing?
>
>
> Best Regards from Paris,
> Eric Chatonet
> ---------------------------------------------------------------------- 
> ------------------------
> http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/
>
>


Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the Use-livecode mailing list