I have a string of email in a variable such as "Bill Warner (abc Ltd.)" <[email protected]>, "Paula Warner" <[email protected]>
I would like to create an array that extract each of the email and returns ["[email protected]","[email protected]"]
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 ?