Restore support for ruby 1.8

Converted 1.9 hash syntax, replaced named capture group for regex
Merge pull request #64 from Malet/patch-1

Restore support for ruby 1.8