I have a string looking like a.
I would like to delete everything before the 2nd to last occurrence of the patter === test, === included.
a <- "=== test : {abc}
      === test : {abc}
      === test : {abc}
      === test : {aUs*} 
      === dce
      === test : {12abc}
      === abc
      === test : {abc}
      === test : {dfg}"
result <- "test : {abc}
           === test : {dfg}"
I tried:
gsub(".*=== test", "", a)
How to set the index 2nd to last?
Thanks
 
     
    