Re: [Rd] grep problem in R-devel 2.14 r57004

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Fri, 16 Sep 2011 09:01:20 -0400

Mark, quick googling gives the answer - [.] is not what you think it is, you probably meant [\.]. Bracket expressions starting with [. are collating symbols which is unsupported by PCRE (only [:xxx:] is supported, neither [=xxx=] nor [.xxx.] is) but that's probably not what you intended. See POSIX:

9.3.5 RE Bracket Expression
[...]
1. [..] The character sequences "[.", "[=", and "[:" (left-bracket followed by a period, equals-sign, or colon) shall be special inside a bracket expression and are used to delimit collating symbols, equivalence class expressions, and character class expressions.

Cheers,
Simon

On Sep 16, 2011, at 12:45 AM, <Mark.Bravington_at_csiro.au> <Mark.Bravington_at_csiro.au> wrote:

> Problem below with PCRE grep in R-devel; works fine in R-patched. (Unless there's been an absolutely massive change in rules for updated PCRE version 8.13; jeez I hope not)
>

>> grep( '[.][.]', '', perl=TRUE)

> Error in grep("[.][.]", "", perl = TRUE) :
> invalid regular expression '[.][.]'
> In addition: Warning message:
> In grep("[.][.]", "", perl = TRUE) : PCRE pattern compilation error
> 'POSIX collating elements are not supported'
> at '[.][.]'
>
>> sessionInfo()

> R Under development (unstable) (2011-09-13 r57004)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
> [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
> [5] LC_TIME=English_Australia.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> NB I'm sending to R-devel rather than posting a bug report because (i) I have a dim recollection that's what we're supposed to do for bugs in R-devel, and (ii) Bugzilla doesn't include an R-devel version and (iii) couldn't find any guidance on these matters.
>
> Mark
>
> --
> Mark Bravington
> CSIRO Mathematical & Information Sciences
> Marine Laboratory
> Castray Esplanade
> Hobart 7001
> TAS
>
> ph (+61) 3 6232 5118
> fax (+61) 3 6232 5012
> mob (+61) 438 315 623
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 16 Sep 2011 - 13:13:36 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 16 Sep 2011 - 14:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive