[Rd] Change in grep behavior from 1.9.0 to R-patched

Roger D. Peng rpeng at jhsph.edu
Fri Jun 11 16:43:57 CEST 2004


I've noticed a change in the way grep() behaves between the 1.9.0 
release and a recent R-patched.  On 1.9.0 I get the following output:

 > x <- dget(file = url("http://www.biostat.jhsph.edu/~rpeng/names.R"))
 > length(grep("^l\\w+tmean", x, perl = TRUE, value = TRUE))
[1] 84

And on R-patched (2004-06-11) I get

 > x <- dget(file = url("http://www.biostat.jhsph.edu/~rpeng/names.R"))
 > length(grep("^l\\w+tmean", x, perl = TRUE, value = TRUE))
[1] 13

I can't come up with a simpler example which is why I've posted my 
actual character vector on the web (please let me know if there are 
problems downloading it).

I didn't find anything in the NEWs file that would indicate a change 
and another problem is that I'm not sure which behavior is correct. 
My knowledge of regular expressions is limited.

-roger



More information about the R-devel mailing list