I am trying to extract all occurrences of the expressions between "[XX]\n-----\n" and "\n-", for all XX. Here is the code I have come up with.
temp <- "\\[\\d+]\n-(.*)\n-"
x <- c("[65]\n-----\n this?\n-, some other rubbish, [3]\n-----\n that?\n-")
str_extract_all(x,temp)
the output is a zero-dim character vector. The desired output is a two-dim character vector with entries "this" and "that".
Any help would be greatly appreciated!
I have tried many rephrasing's of the regular expression. The problem is in the positive lookbehind, but I can't figure it out. I've tried finding related articles, but no luck
*edited code typo