x <- "2019/01/01/07/556662_cba3a4fc-cb8f-4150-859f-5f21a38373d0"regmatches(x, regexpr(".*/([0-9]+)", x, perl=TRUE))sub(".*/([0-9]+).*", "\\1", x)
Standard input is empty
[1] "2019/01/01/07/556662" [1] "556662"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!