Skip to content
Prev 70233 / 398525 Next

Backslash

Josef Eschgfaeller wrote:
The general reason is that both R and grep use \ as an escape character. 
  If you want to send an escape to grep you need to escape the escape in R.
No.  The first one passes the string containing "\{[\-u]x" to grep 
(after processing the escapes).  The second one passes "{[-u]x" to grep.
\w has no special meaning in R, so this pattern becomes "w".
This is the pattern "\w".  I don't know if this has special meaning to 
pcre, but I guess it must, or you wouldn't have tried it.

Duncan Murdoch