fork(1) download
  1. s = 'there is a cat in the hat.it has a 2.0 inch tail!'
  2. puts s.gsub(/(\A|[.?!])(\p{Ll})/) { Regexp.last_match(1).length > 0 ? "#{$1} #{$2.capitalize}" : "#{$2.capitalize}" }
Success #stdin #stdout 0.02s 9784KB
stdin
Standard input is empty
stdout
There is a cat in the hat. It has a 2.0 inch tail!