No description or website provided.
Latest commit 12b915f Jun 9, 2014 @ledermann Convert specs to RSpec 3.0.0 syntax with Transpec
This conversion is done by Transpec 2.2.1 with the following command:

* 18 conversions
    from: == expected
      to: eq(expected)

* 18 conversions
    from: obj.should
      to: expect(obj).to

* 1 conversion
    from: lambda { }.should_not
      to: expect { }.not_to

For more details:
Failed to load latest commit information.
spec Convert specs to RSpec 3.0.0 syntax with Transpec Jun 9, 2014
.gitignore Ok, let's go! Dec 5, 2011
.travis.yml Fixed some regex to work with Ruby 2.0, too Feb 27, 2013 Ok, let's go! Dec 5, 2011
Gemfile Ok, let's go! Dec 5, 2011
Rakefile Ok, let's go! Dec 5, 2011
address_parser.gemspec Ok, let's go! Dec 5, 2011


Build Status

Ruby gem for parsing a (multiline) string containing an address and identifying its parts with Regex. It's useful to copy & paste contact or address informations from unformatted source (e.g. a website) into your schema based database.

Beware: This project is in early alpha state and needs a lot of work to be useful. So far it's just a project started on a rainy weekend. I'm not sure about its future.


Add this to your Gemfile:

gem 'address_parser', :git => 'git://'

(not released to, yet)


address = <<-EOT
  Peter Meier
  Marienburger Straße 29
  50374 Erftstadt
  Fon (02235) 123456
  Fax (02235) 654321
EOT == {
  :first_name     => 'Peter',
  :last_name      => 'Meier',
  :street         => 'Marienburger Straße 29',
  :zip            => '50374',
  :city           => 'Erftstadt',
  :country        => 'DE',
  :phone          => '(02235) 123456',
  :fax            => '(02235) 654321',
  :web            => '',
  :email          => ''

A lot of variants are recognized


  • It uses no databases (e.g. for first names or cities), so it can't be perfect
  • It recognizes only german addresses (yet)
  • It does not format any phone numbers. If you need this, look at additional Ruby gems like Phony or Dialy

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. No discussion. No tests, no game. We use rspec for testing.
  • Commit, do not mess with rakefile, version, or history. If you want to have your own version, thats fine. But bump your version in a seperate commit that can be ignored when pulling.
  • Send me a pull request. Bonus points for topic branches.


There is a commercial alternative named RecogniContact which is much more powerful - but closed source.


Copyright © 2011,2012 Georg Ledermann. See LICENSE for details.