X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <507DAF77.9080903@etr-usa.com> Date: Tue, 16 Oct 2012 13:03:19 -0600 From: Warren Young User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Cygwin-L Subject: Re: R 2.15.1-1 sub() function produces unexpected output References: <5078A002 DOT 8070407 AT etr-usa DOT com> In-Reply-To: <5078A002.8070407@etr-usa.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 10/12/2012 4:56 PM, Warren Young wrote: > On 10/12/2012 9:18 AM, Toby Johnson wrote: >> >> The sub() function in R 2.15.1-1 produces unexpected output. Here is >> a minimal piece of R code: > > I believe sub() is using PCRE for this, per http://goo.gl/XxDyB I just looked back at this and since there was no further commentary, I decided to dig a little deeper, and saw the "perl" parameter to sub(). It turns out that it defaults to FALSE, meaning it *doesn't* use PCRE by default. But if you set it to TRUE, Cygwin R behaves as you expect, Toby. So, the bug must either be in the other regex library R uses by default, or in the R-side wrapper for the call out to that library. If it were in the mainline R code, the value of this parameter wouldn't matter. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple