Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-17 Thread Prof Brian Ripley
On Thu, 17 May 2007, Petr Savicky wrote: >> strncasecmp is not standard C (not even C99), but R does have a substitute >> for it. Unfortunately strncasecmp is not usable with multibyte charsets: >> Linux systems have wcsncasecmp but that is not portable. In these days of >> widespread use of UTF

Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-17 Thread Petr Savicky
> strncasecmp is not standard C (not even C99), but R does have a substitute > for it. Unfortunately strncasecmp is not usable with multibyte charsets: > Linux systems have wcsncasecmp but that is not portable. In these days of > widespread use of UTF-8 that is a blocking issue, I am afraid.

Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-14 Thread Prof Brian Ripley
On Fri, 11 May 2007, Petr Savicky wrote: > On Wed, May 09, 2007 at 06:41:23AM +0100, Prof Brian Ripley wrote: >> I suggest you collaborate with the person who replied that he thought this >> was a good idea to supply patches against the R-devel sources for >> scrutiny. > > A possible solution is t

Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-11 Thread Petr Savicky
On Wed, May 09, 2007 at 06:41:23AM +0100, Prof Brian Ripley wrote: > I suggest you collaborate with the person who replied that he thought this > was a good idea to supply patches against the R-devel sources for > scrutiny. A possible solution is to use strncasecmp instead of strncmp in function

Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-08 Thread Prof Brian Ripley
On Mon, 7 May 2007, Petr Savicky wrote: > Dear R developers, > > I suggest to modify the behaviour of "grep" function with fixed=TRUE option. > > Currently, fixed=TRUE implies ignore.case=FALSE (overrides ignore.case=TRUE, > if set by the user). As it clearly says it does. > I suggest to keep ig

Re: [Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-07 Thread Gabor Grothendieck
Seems like a good idea to me. Here is a workaround that works in any event which combines (?i), \Q and \E . to get the same effect. (?i) gives case insensitive matches and \Q and \E quote and endquote the intervening text disabling special characters: x <- c("D.G cat", "d.g cat", "dog cat") z <-

[Rd] grep with fixed=TRUE and ignore.case=TRUE

2007-05-07 Thread Petr Savicky
Dear R developers, I suggest to modify the behaviour of "grep" function with fixed=TRUE option. Currently, fixed=TRUE implies ignore.case=FALSE (overrides ignore.case=TRUE, if set by the user). I suggest to keep ignore.case as set by the user even if fixed=TRUE. Since the default of ignore.case