delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/10/16/15:03:44

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 <warren AT etr-usa DOT 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 AT cygwin DOT com>
Subject: Re: R 2.15.1-1 sub() function produces unexpected output
References: <E22AEA3456883C41AD71DA029D05F48819AC35BD AT 019-AM1MPN1-011 DOT 019D DOT MGD DOT MSFT DOT NET> <5078A002 DOT 8070407 AT etr-usa DOT com>
In-Reply-To: <5078A002.8070407@etr-usa.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019