I have text like
la<-c("case when ANTIG_CLIENTE <= 4 then '01: ANTIG_CLIENTE <= 4' when ANTIG_CLIENTE <= 8 then '02: ANTIG_CLIENTE <= 8'
else '99: Error' end ")
I want to extract the text between single quotes as a list:
"01: ANTIG_CLIENTE <= 4","02: ANTIG_CLIENTE <= 8","99: Error"
I tried two approaches with no success
> sub('[^\]+\"([^\']+).*', '\\1', la)
Error: '\]' is an unrecognized escape in character string starting "'[^\]"
> regmatches(x, gregexpr('"[^']*"', la))[[1]]
Error: unexpected ']' in "regmatches(x, gregexpr('"[^']"
How can I get the text between single quotes?