Full_Name: Leon C. Banza Version: 2.8.1 OS: Windows Vista Submission from: (NULL) (195.69.243.253) I believe there is a serious bug in the code for sub and gsub. I do as following: gsub("\\", "-", "some\\backslashed\\string") This ought return "some-backslashed-string", but prints warnings instead: Error in sub("\\", "", "baba\\") : invalid regular expression '\' In addition: Warning message: In sub("\\", "", "baba\\") : regcomp error: 'Trailing backslash' I believe this is a matter of a simple correction in the source code. Leon
ligges at statistik.tu-dortmund.de
2009-Jan-21 16:55 UTC
[Rd] Bug in sub and gsub (PR#13460)
banzaleon at gmail.com wrote:> Full_Name: Leon C. Banza > Version: 2.8.1 > OS: Windows Vista > Submission from: (NULL) (195.69.243.253) > > > I believe there is a serious bug in the code for sub and gsub. I do as > following: > > gsub("\\", "-", "some\\backslashed\\string")This is a user bug. You need gsub("\\\\", "-", "some\\backslashed\\string") Please read the documentation before submitting bug reports!!! Uwe Ligges> This ought return "some-backslashed-string", but prints warnings instead: > > Error in sub("\\", "", "baba\\") : invalid regular expression '\' > In addition: Warning message: > In sub("\\", "", "baba\\") : regcomp error: 'Trailing backslash' > > I believe this is a matter of a simple correction in the source code. > > Leon > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel