I have a string of email in a variable such as "Bill Warner (abc Ltd.)" <bill@abc.com>, "Paula Warner" <paula@abc.com>
I would like to create an array that extract each of the email and returns ["bill@abc.com","paula@abc.com"]
I find a way to make the extraction, using a custom function:
def string_between_markers marker1, marker2
self[/#{Regexp.escape(marker1)}(.*?)#{Regexp.escape(marker2)}/m, 1]
end
Only issue, is that this works only once. What would be the right method to extract each of the email address please ?