#!/usr/bin/perl use warnings;use strict; foreach () { s{ (^|\.) # Start of string, or last full-stop (.*?) # Non-alpha characters (non-greedy) ([a-zA-Z]) # First alphabetic character ([^\.]*) # Through to next full stop }{ $1.$2.uc($3).lc($4) }gex; print; } __DATA__ today is wednesday.tomorrow IS THURSDAY. I am trying to write a regex to convert the first letter and any letter following a full stop in a string to uppercase .and . all the other characters to lowercase.