Cleanup regex and support for jruby on heroku