Re: regex.e find_all
- Posted by jessedavis Mar 26, 2010
- 875 views
there is an easy fix for this problem. It's not elegant but add one line of code (next to the last line below) to the function find_all() in regex.e--->
public function find_all(regex re, sequence haystack, integer from=1, object options=DEFAULT) if sequence(options) then options = or_all(options) end if object result sequence results = {} while sequence(result) with entry do results = append(results, result) from = max(result) + 1 if from > length(haystack) then exit end if entry result = find(re, haystack, from, options) end while if length(results) then return results else return -1 end if end function