s = "Berat: 0.25kg\nRp 115.000\nJumlah:\nBeli\nKe Dafta"gsub("(?s).*(Rp\\s+\\d+\\.\\d+).*", "\\1", s, perl=T)
Standard input is empty
[1] "Rp 115.000"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!