Re: regex.e find_all

new topic     » goto parent     » topic index » view thread      » older message » newer message

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 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu