美文网首页R - tips
stringr::str_detect 忽略大小写

stringr::str_detect 忽略大小写

作者: 董八七 | 来源:发表于2018-05-16 15:05 被阅读1次

stringr::str_detect默认是区分大小写的,但有时想要忽略,怎么办?

str_extract_all(sents, regex(namesToExtract, ignore_case=TRUE))

str_detect(string, regex(pattern, ignore_case = T))
str_detect(string, fixed(pattern, ignore_case = T))

from stringr - R: How to ignore case when using str_detect? - StackOverflow

相关文章

网友评论

    本文标题:stringr::str_detect 忽略大小写

    本文链接:https://www.haomeiwen.com/subject/swbpdftx.html