[R] gsubfn, strapply, REGEX Problem

Johannes Graumann johannes_graumann at web.de
Tue Oct 28 13:32:35 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Thanks for looking at this. The "\"" was an oversight for the example, but the "backref" bit solves my problem ... I wonder whether that used to be the default and was recently changed?

Thanks for your help!

Joh

Gabor Grothendieck wrote:

> There is no quote terminating the first argument and you
> need to add the backref = 0 argument so that it does
> not interpret the parentheses in the regular expression
> as back references.
> 
> Its not clear to me what the intention is here so there
> may be further changes needed but the ones above
> result in no error message.
> 
> On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
> <johannes_graumann at web.de> wrote:
>> Hi all,
>>
>> I swear this used to work:
>>
>> library(gsubfn)
>> strapply("S(AC,P)TVDK(8)EELVQK(8), ".[(].{1,2}[)]|.")[[1]]
>>
>> But somewhere along the update path it stopped ... now giving me this
>>
>> Error in base::gsub(pattern, rs, x, ...) :
>>  invalid backreference 2 in regular expression
>>
>> Can't figure it out. What am I doing wrong?
>>
>> Thanks for any hints, Joh
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html and provide commented,
>> minimal, self-contained, reproducible code.
>>
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented,
> minimal, self-contained, reproducible code.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCgAGBQJJBwZjAAoJEK3uDRxoATjEb9gP/ioWCERhZrLAaeIPMc1PSmVV
nsWojOneSNruSESMgmocrKkOYbkPVZmmBetK9gw4sw9hLErGjy1MsebHVr40pNK2
Bajm7mXJ1wbd7EDlvRfS3KpBkPvPlUmSMlp2fMoYaswcyt6Rokr3S512UlkvlLWU
QNd8NMx4iRFPn3dA84SW1SqWaKIXtpTME35k1VQw0dGvv8iTgsY6pAHWkEoezuue
g/tGY8kc2WjBpvVjSVDD4uAuzO9T502n1AjsUs+/bxVRBPIJJktFzkOJbhKQabuJ
2NfEX45B4Y/f1nMff5KQ1IS4LQUUzNwzvEuwHuw2CXfKnzopNUUjU3rcCaHwOIJz
yecnRXpGwVX+dHaLH156voiHJqpsz7tUoIUOvAQumfwmPajK9Z/KKwLoXdXQ22gB
5469gcVBI+z31euijZMRMW12M7ZidABnHd2afxrwQRZyU9sexemzVzSdAlIpIgr5
JG62rxpFY2ImmzTDncZpNik68cviB1ZLloH4twJxFk/T7DmS3x17wVofPb1yOZDq
TYCvRcGIihhZ3fZM/m2qExv+bkCS80CnY1qMY+o8BmTDcp6hH64UpCQz17o/8JG9
Fo8jjLRghuh1DBThL6zrzg+70UTqhNWXdBSLs/UPB1W8i1Xk+PTIFLWGigq1+3ty
KoHmwgt/Bd27e2XO+leu
=JlLi
-----END PGP SIGNATURE-----



More information about the R-help mailing list