gsub("([^\\s@]+@[^\\s@]+\\.)([^\\s@]+)","\\1\\L\\2", "something@somewhere.COM", perl = T)
Standard input is empty
[1] "something@somewhere.com"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!