str_detect 的帮助页面指出“相当于 grepl(pattern, x)”,但是:
str_detect("ALL-", str_c("\\b", "ALL-", "\\b"))
[1] FALSE
Run Code Online (Sandbox Code Playgroud)
尽管
grepl(str_c("\\b", "ALL-", "\\b"), "ALL-")
[1] TRUE
Run Code Online (Sandbox Code Playgroud)
我想其中之一没有按预期工作?或者我错过了什么?