jnicklas/carrierwave — pull request #779 by cc (2012-07-06 16:05:12+00:00)
Title: Add support for underscores in AWS bucket names when using fog

The regex at:
https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L289
is super inefficient running ree-1.8.7 when the AWS bucket name contains a number of alpha numeric characters and then an underscore followed by further alpha numeric characters.

To replicate in a ree-1.8.7 console try

'tessssssssst_aws_bucket' =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\d{1,3}){3}$))(?:[a-z0-9]|(?![\-])|\-(?![\.])){1,61}[a-z0-9]$/

and it will just hang and then eventually return nil. Since underscores are valid in AWS bucket names this pull request adds support for them.

Note that the hanging issue isn't an issue in 1.9.2 or 1.9.3.