Restore support for ruby 1.8

Converted 1.9 hash syntax, replaced named capture group for regex