Original date:2021-02-13 11:58:28 Edited by: ghaberek Subject: Re: question about find function

Yes, you're looking for match() not find(). There is a fundamental difference in how these work.

The find() function locates an item in a sequence, and with strings each character is an atom that is an item in the sequence, so you're looking for atoms.

? find( 'D', "ABCDEF" ) 
? find( "D", "ABCDEF" ) 

The match() function locates a matching subset of a sequence, and so with strings you're looking a partial string match in a larger string.

? match( 'D', "ABCDEF" ) 
-- crashes, expects 'D' to be a sequence 
? match( "D", "ABCDEF" ) 
? match( "BCD", "ABCDEF" ) 

And you would use find() to locate a string in a sequence of strings, since those strings are items in the sequence.

? find( "DEF", {"ABC","DEF","GHI"} ) 

Hope this helps.

P.S. I agree the documentation needs work. I've asked for help contributing updates and corrections to the documentation. Anyone who wants to offer corrections is free to submit pull requests on GitHub:


Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu