Re: [R] : regular expressions: escaping a dot

From: Peter Dalgaard <P.Dalgaard_at_biostat.ku.dk>
Date: Thu, 28 Jun 2007 15:04:43 +0200

Prof Brian Ripley wrote:
>
>
> This is explained in ?regexp (in the See Also of ?regexpr):
>
> Patterns are described here as they would be printed by 'cat': _do
> remember that backslashes need to be doubled when entering R
> character strings from the keyboard_.
>
> and in the R FAQ and ....
>
>
Hmm, that's not actually correct, is it? Perhaps this is better

"...entering R character string literals (i.e., between quote symbols.)"

The counterexample would be

> readLines()

\\abc
[1] "\\\\abc"

(of course it is more important to get people to read the documentation at all...)

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help_at_stat.math.ethz.ch 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.
Received on Thu 28 Jun 2007 - 13:10:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Jun 2007 - 15:32:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.