Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要 TRUE FALSE 而不是以下。有什么建议吗?
testLines <- c("buried","medium-buried") grepl('\\<buried\\>',testLines) [1] TRUE TRUE
也许这个?
testLines <- c("buried","medium-buried") grepl('^buried$',testLines) #[1] TRUE FALSE
我的理解(并且正则表达式不是我的强项)是^表示字符串的开头和$结尾。
^
$