Re: [Rd] The regular expressions in compareVersion()

2014-04-26 Thread Duncan Murdoch
On 26/04/2014, 3:36 AM, peter dalgaard wrote: On 25 Apr 2014, at 14:50 , peter dalgaard wrote: Thanks. I've put in a bug report on this one now, so it shouldn't get missed again. If nobody else gets to it first I'll deal with it. I don't see any value in fixing the compareVersion example,

Re: [Rd] The regular expressions in compareVersion()

2014-04-26 Thread peter dalgaard
On 25 Apr 2014, at 14:50 , peter dalgaard wrote: >> Thanks. I've put in a bug report on this one now, so it shouldn't get >> missed again. If nobody else gets to it first I'll deal with it. >> >> I don't see any value in fixing the compareVersion example, but if someone >> submits a bug rep

Re: [Rd] The regular expressions in compareVersion()

2014-04-25 Thread peter dalgaard
On 25 Apr 2014, at 14:04 , Duncan Murdoch wrote: > On 24/04/2014, 10:27 PM, Simon Urbanek wrote: >> FWIW the link has a long thread that is 90% irrelevant - AFAICS the relevant >> part is >> >> From: Yihui Xie-2 >> Sep 02, 2013; 4:11pm >> Re: Sweave: printing an underscore in the output from a

Re: [Rd] The regular expressions in compareVersion()

2014-04-25 Thread Duncan Murdoch
On 24/04/2014, 10:27 PM, Simon Urbanek wrote: FWIW the link has a long thread that is 90% irrelevant - AFAICS the relevant part is From: Yihui Xie-2 Sep 02, 2013; 4:11pm Re: Sweave: printing an underscore in the output from an R command [...] Now you are good at the regular expression level, bu

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Simon Urbanek
FWIW the link has a long thread that is 90% irrelevant - AFAICS the relevant part is From: Yihui Xie-2 Sep 02, 2013; 4:11pm Re: Sweave: printing an underscore in the output from an R command [...] Now you are good at the regular expression level, but Sweave comes and bites you, and that is due t

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Yihui Xie
You are right that this is unlikely to cause problems, because users are unlikely to put backslashes in version numbers. Henrik has pointed out the problem. It is not about "making the source code a little cleaner", but "making it correct". Either someone in R core corrects the wrong regular expres

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Duncan Murdoch
On 24/04/2014, 5:26 PM, Henrik Bengtsson wrote: On Thu, Apr 24, 2014 at 1:42 PM, Duncan Murdoch wrote: On 24/04/2014, 1:11 PM, Yihui Xie wrote: Hi, I guess the backslash should not be used as the separator for strsplit() in compareVersion(), because the period in [.] is no longer a metachara

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Henrik Bengtsson
On Thu, Apr 24, 2014 at 1:42 PM, Duncan Murdoch wrote: > On 24/04/2014, 1:11 PM, Yihui Xie wrote: >> >> Hi, >> >> I guess the backslash should not be used as the separator for >> strsplit() in compareVersion(), because the period in [.] is no longer >> a metacharacter (no need to "escape" it using

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Duncan Murdoch
On 24/04/2014, 1:11 PM, Yihui Xie wrote: Hi, I guess the backslash should not be used as the separator for strsplit() in compareVersion(), because the period in [.] is no longer a metacharacter (no need to "escape" it using a backslash): https://github.com/wch/r-source/blob/trunk/src/library/uti

[Rd] The regular expressions in compareVersion()

2014-04-24 Thread Yihui Xie
Hi, I guess the backslash should not be used as the separator for strsplit() in compareVersion(), because the period in [.] is no longer a metacharacter (no need to "escape" it using a backslash): https://github.com/wch/r-source/blob/trunk/src/library/utils/R/packages.R#L866-L867 > compareVersion