You can use this to match the first character in each word. Use a function to then iterate over the matches to transform into the various cases.