[Rd] regexp with [:upper:] (PR#11032)
Mark.Bravington at csiro.au
Mark.Bravington at csiro.au
Tue Mar 25 06:47:17 CET 2008
Aaargh, sorry. I thought it might be to do with Australian English...
Prof Brian Ripley wrote:
> That is correct: I suspect you meant the character class [[:upper:]]
>
>> grep( '[[:upper:]]', letters, val=TRUE) character(0)
>
> You asked for matches amongst :upper:, and that is what you got.
> As ?rexexp does say
>
> (Note that the
> brackets in these class names are part of the symbolic
> names, and
> must be included in addition to the brackets delimiting the
> bracket list.)
>
> this appears to be a homework failure.
>
> On Tue, 25 Mar 2008, mark.bravington at csiro.au wrote:
>
>> Full_Name: Mark Bravington
>> Version: 2.6.2 patched
>> OS: Windows XP Pro
>> Submission from: (NULL) (140.79.22.104)
>>
>>
>>> grep( '[:upper:]', letters, val=T) # shurely shouldn't
> match anything ??
>> [1] "e" "p" "r" "u"
>>
>> The converse ( '[:lower:]' and LETTERS) seems to work OK.
>>
>> --please do not edit the information below--
>>
>> Version:
>> platform = i386-pc-mingw32
>> arch = i386
>> os = mingw32
>> system = i386, mingw32
>> status = Patched
>> major = 2
>> minor = 6.2
>> year = 2008
>> month = 03
>> day = 21
>> svn rev = 44836
>> language = R
>> version.string = R version 2.6.2 Patched (2008-03-21 r44836)
>>
>> Windows XP (build 2600) Service Pack 2
>>
>> Locale:
>>
> LC_COLLATE=English_Australia.1252;LC_CTYPE=English_Australia.1252;LC_M
>>
> ONETARY=English_Australia.1252;LC_NUMERIC=C;LC_TIME=English_Australia.
>> 1252
>>
>> Search Path:
>> .GlobalEnv, package:stats, package:graphics, package:grDevices,
>> package:utils, package:datasets, package:methods, Autoloads, pa
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
--
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
More information about the R-devel
mailing list