Backported a feature of Regexp to meet the needs of using ruby 1.8.7, GRUMBLE