Allow matchText to return a list
Posted: 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
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