From xiao.gang.fan1 at libertysurf.fr  Wed Jan  3 18:55:22 2007
From: xiao.gang.fan1 at libertysurf.fr (xiao.gang.fan1 at libertysurf.fr)
Date: Wed,  3 Jan 2007 18:55:22 +0100 (CET)
Subject: [Rd] pb in regular expression with the character "-" (PR#9437)
Message-ID: <20070103175522.D1D843F03E@slim.kubism.ku.dk>

Full_Name: FAN
Version: 2.4.0
OS: Windows
Submission from: (NULL) (159.50.101.9)


These are expected:

> grep("[\-|c]", c("a-a","b"))
[1] 1

> gsub("[\-|c]", "&", c("a-a","b"))
[1] "a&a" "b"  

but these are strange:

> grep("[d|\-|c]", c("a-a","b"))
integer(0)

> gsub("[d|\-|c]", "&", c("a-a","b"))
[1] "a-a" "b"  

Thanks



[Rd] pb in regular expression with the character "-" (PR#9437)
xiao.gang.fan1 at libertysurf.fr