x <- "248_HIGH_FAN_BLADE,\n67B_COOLER_BLADE,\nBLADE_LOW_DIM"regmatches(x, gregexpr("(?m)^.*?\\K[0-9A-Z]_[0-9A-Z]", x, perl=TRUE))
Standard input is empty
[[1]] [1] "8_H" "B_C" "E_L"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!