1) is a simple split and the collect generates a new array from executing the block on each item of the array generated by the split
the block is a simple regex substitution
2) I am not sure I understand the second part of your question actually
Do you want to safe the attachment and give it an extension based on the mime type?
Main Topics
Browse All Topics





by: GertonePosted on 2009-05-05 at 00:56:32ID: 24302335
I can answer 1) first
.collect{| item| item.gsub(/^.*<([^>]+)>.*$/, '\1')}
email_addresses = '"Stuart Smith" <stuart@email.com>, "Community" <comm@email.com>'
emails = email_addresses.split(/,/)