R语言 正则表达式 从字符串中提取数字
pattern <- "(?<ID>[0-9]+)"result <- regexpr(pattern= pattern, text = lj$line, perl=TRUE)start <- attr(result,"capture.start")length <- attr(result,"capture.length")name <- attr(result,"capture.name")geneID <- ifelse(start > 0, substr(lj$line, start[,name],start[,name] + length[,name]-1),NA)