Method RegEx():findAll() Foundation

Finds all match positions.

Syntax
:findAll( <cSubject>, [<nLimit>] ) --> aStartPositions
Parameters
<cSubject>
The subject string to search.
<nLimit>
An optional maximum number of positions to return. This defaults to 10000.
Return

An array with the starting positions or an empty array ({}) if no match is found.

Description

Returns an array containing the starting positions of all matches in the subject string. This is more efficient than :matchAll() when only positions are needed.

Find all

oRegEx := RegEx():create("ERROR") 
aPositions := oRegEx:findAll("ERROR 1, WARNING, ERROR 2") 
? aPositions  // {1, 19} 
oRegEx:destroy() 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.