Ruby 1.8 compatibility

Don't use regex's lookbehind as it's not supported in Ruby 1.8