fixed regex for Rails 4

Fixes #46
Fixes #45