Parse a list of emails pasted into a web form, returning a hash with valid emails as keys and associated data (i.e. names) as values. Pasted values can be comma or line separated. Invalid values are returned in an array.
The default regular expression used for parsing can be overridden with an optional second argument.
Tested with Ruby 1.9.3 but should work with earlier versions.
- git clone git://github.com/victorgrey/email_addresses_parser.git
- cd email_addresses_parser
- gem build email_addresses_parser.gemspec
- (sudo) gem install email_addresses_parser-x.x.x.gem
valid_items_hash, invalid_items_array = EmailAddressesParser.parse_list(email_addresses_list)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Copyright (c) 2012 Victor Grey. See LICENSE for details.