【R语言】正则表达式提取特定字符串

>   tmp = strsplit(as.character(colname[i, ]),'[0-9]') # 先拆分出想要的子字符串
>   tmp
[[1]]
[1] ""                                    ""                                   
[3] " - "                                 ""                                   
[5] "  Players name (in quotation marks)"

>   ind = grep("[A-Z]", tmp[[1]]) # 再定位
>   ind
[1] 5
>   print(paste("i",i,"tmp",tmp[[1]][ind])) # 提取
[1] "i 18 tmp   Players name (in quotation marks)"

你可能感兴趣的:(R语言,正则表达式,r语言)