From rpeng at jhsph.edu  Fri Jun 11 16:43:57 2004
From: rpeng at jhsph.edu (Roger D. Peng)
Date: Fri Jun 11 16:44:02 2004
Subject: [Rd] Change in grep behavior from 1.9.0 to R-patched
Message-ID: <40C9C52D.4020900@jhsph.edu>

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


[Rd] Change in grep behavior from 1.9.0 to R-patched
Roger D. Peng