String#gsub fix with last character
Merge pull request #847 from bovi/gsub

String#gsub fix with last character