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

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to