fork(1) download
  1. examples <- c( "abc foo", "abc foo 17", "0 abc defg foo 5 121", "abc 12 foo defg 11" )
  2. res <- gsub(".*?foo\\D*(\\d+).*|.*", "\\1", examples)
  3. res[nchar(res)==0] <- NA
  4. ## => [1] NA "17" "5" "11"
  5.  
Success #stdin #stdout 0.15s 175424KB
stdin
Standard input is empty
stdout
Standard output is empty