I have a string data as follows:
a<- "\n Update Your Profile to Dissolve This Message\nSocial Media Learning and behaviour\n Uploaded on May 3, 2020 at 10:56 in Research\n View Forum\n \n"
I have to extract the string "Social Media Learning and behaviour" for this I used the below code:
gsub(" Uploaded on .* ", "", gsub("\n Update Your Profile to Dissolve This Message\n", "",a))
This gives me output as below
"Social Media Learning and behaviour\n\n"
I am not able to match the exact pattern. What can be the exact pattern to extract "Social Media Learning and behaviour" without "\n\n"