proper = function(x){ gsub("(*UCP)\\b([[:alpha:]])", "\\U\\1", x, perl = TRUE)}proper("Māori")
Standard input is empty
[1] "Māori"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!