I have these strings:
myseq <- c(\"ALM_GSK_LN_06.ID\",\"AS04_LV_06.ID.png\",\"AS04_SP_06.IP.png\")
What I want to do is to capture parts of
Totally stealing @hwnd's regex but in a tidyr/dplyr approach:
library(dplyr); library(tidyr) data_frame(myseq) %>% extract(myseq, c('A', 'B', 'C'), '(.+)_([A-Z]+)[^.]+\\.([A-Z]+)') ## A B C ## 1 ALM_GSK LN ID ## 2 AS04 LV ID ## 3 AS04 SP IP