“'\w' is an unrecognized escape” in grep

后端 未结 1 1051
情深已故
情深已故 2020-11-30 11:27

I\'m using grep in some projects in R (which uses a perl=TRUE flag) and for the life of me I can\'t figure out why R keeps throwing errors. My query is as follo

相关标签:
1条回答
  • 2020-11-30 12:20

    You need to escape the backslashes one more time in r.

    d$SomeColumn[grep("(?ix)<VNW[^;]*;(dis|dat)> \\w*<N\\(", d$Right, perl=TRUE)] <- 1
    
                                                  |     |
    
    0 讨论(0)
提交回复
热议问题