Okay - maybe this is a better example. I am looking for guidance/references on how to reference a variable within a regex - not how to build a regex for this data.
Try this:
> d1 <- c("CCA: 135 cm/sec ICA: 50 cm/sec", "CCA: 150 cm/sec ICA: 75 cm/sec") > t(strapplyc(d1, "\\w+: \\S+ \\S+", simplify = TRUE)) [,1] [,2] [1,] "CCA: 135 cm/sec" "ICA: 50 cm/sec" [2,] "CCA: 150 cm/sec" "ICA: 75 cm/sec"