Remove extra period in regex for ruby