Finding all incidences of a searchPattern in a web page

I want to be able to scrape all the email addresses from a web page. Although the search pattern works, how do I get it to return all instances of the pattern and say put them into a listbox?

Here is what I have so far that works.

rg.searchPattern = “\b[A-Z0-9._%±]+@[A-Z0-9.-]+.[A-Z]{2,}\b”

myMatch = rg.search(textField1.text)

if myMatch <> nil then
s = myMatch.SubExpressionString(0)
msgBox s
end if

I thought perhaps regEx could create an array of matches that I could loop through or something but apparently not. Couldn’t find anything in the LR.

Call .Search again in a loop. See the LR under Regex.Search:

If you call Search with no parameters after initially passing a TargetString , it assumes the previous TargetString and will begin the search where it left off in the previous call. This is the easiest way to find the next occurrence of SearchPattern in TargetString .

Oh I see now. Must have missed that. Thanks.