Allow matchText to return a list

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Allow matchText to return a list

Post by WaltBrown » Wed Oct 20, 2010 7:07 am

Hi!
I thought a useful feature would be for matchText (and matchChunk and offset) to return a list if there was more than one match in the search field.

So it would be matchText(stringToSearch,regEx,foundTextVarList) where foundTextVarList can be treated as a list, rather than requiring the app to know ahead of time how many returns there might be. That would work as well for regExps that returned repeating alternating patterns as in the matchText Dictionary entry. The repeat loop for large searches would then be executed more efficiently at a lower level than the script, and the app would not have to either know ahead of time how many finds there might be or implement an indeterminate repeat loop.

BR, Walt
Walt Brown
Omnis traductor traditor

Post Reply