#23456789_123456789_123456789_123 (33) s/[^.]+.\s*/\u\L$&/g;s/\bi\b/I/g; # Or for cases with leading whitespace #23456789_123456789_123456789_1234 (34) s/\s+|[^.]+./\u\L$&/g;s/\bi\b/I/g;