fork download
  1. x <- "50A ABC DE 51A FG 52A HI 53A"
  2. rx <- "\\G(?:(?! X ).)*?\\K\\b\\d+A\\b"
  3. regmatches(x, gregexpr(rx, x, perl=TRUE))
  4. x <- "50A ABC DE 51A FG X 52A HI 53A"
  5. regmatches(x, gregexpr(rx, x, perl=TRUE))
Success #stdin #stdout 0.24s 39392KB
stdin
Standard input is empty
stdout
[[1]]
[1] "50A" "51A" "52A" "53A"

[[1]]
[1] "50A" "51A"