Fix for ruby 1.8.7

Ruby 1.8.7 doesn't allow a block to be passed to a regular expression
match method...