I have a line as shown below.
testSampe <- "Old:windows\r\nNew:linux\r\n"
I want to erase a line between ":"a "\".
Like this "Old\r\nNew\r\n".
How can I create a regex for this?
I tried to execute the gsub function with regex ":.*\\\\", it does not work.
gsub(":.*\\\\", "\\\\r", testSampe)
source
share