Q: How to grep all strings between two strings in a vector I have a character vector:
FINDINGS<-c("FD_BarrettDetail", "The segment looks flat.", "Prague score C0M3", 
"It is x cm in length.", "This is an ultra-short segment.", "FD_BarrettDetail1_Benign", 
"The segment looks flat.", "No nodularity is present.", "It is a long segment.", 
"Some areas of vascular abnormalities are seen.", "The pit pattern is normal.")

I want to extract all the values that are between FD_BarrettDetail and FD_BarrettDetail1_Benign (excluding the delimiters) so that I get:
Extract<-c("The segment looks flat.", "Prague score C0M3", 
"It is x cm in length.", "This is an ultra-short segment.")


A: Use == and which to create indexes for start and end for capturing all inside this interval.
> start <- which(FINDINGS=="FD_BarrettDetail")+1
> end <- which(FINDINGS=="FD_BarrettDetail1_Benign")-1
> FINDINGS[start:end]
[1] "The segment looks flat." "Prague score C0M3" "It is x cm in length."          
[4] "This is an ultra-short segment."
> 

