s = "2015-12-292016-01-28"sub("\\B(\\d{4}-\\d{2}-\\d{2})", " \\1", s)
Standard input is empty
[1] "2015-12-29 2016-01-28"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!