X-Recipient: archive-cygwin@delorie.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 <warren@etr-usa.com>
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 <cygwin@cygwin.com>
Subject: Re: R 2.15.1-1 sub() function produces unexpected output
References: <E22AEA3456883C41AD71DA029D05F48819AC35BD@019-AM1MPN1-011.019D.MGD.MSFT.NET> <5078A002.8070407@etr-usa.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

