Hi folks,
Can anyone enlighten me as to why I get the following when I search for
".csv" at the end of a string?
> grep("\.csv$","Blah.csv",value=TRUE)
[1] "Blah.csv"
Warning messages:
1: '\.' is an unrecognized escape in a character string
2: unrecognized escape removed from "[\.]csv$"
R reference for regular expressions says
"Any metacharacter with special meaning may be quoted by preceding it
with a backslash. [...] The metacharacters in EREs are . \ | ( ) [ { ^
$ * + ?"
Am I missing something here? If "\." is not the right way to match a
period, can anyone tell me what is? I can't find anything on this in R
reference...
I'm using R 2.6 on Windows XP
Thanks,
Alec Zwart
CMIS CSIRO
[EMAIL PROTECTED]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.