R-alpha: R-beta: regex

Peter Dalgaard BSA p.dalgaard@kubism.ku.dk
22 May 1997 19:15:44 +0200


Thomas Lumley <thomas@biostat.washington.edu> writes:

> 
> On 22 May 1997, Peter Dalgaard BSA wrote:
> > 
> > In what connection? In egrep, consider taking some of them out:
> > 
> 
> I meant the grep() function in R (which needs \ to be quoted)
>  grep("([A-Za-z][^:]*):\1","Ac:Ac",value=T)
> character(0)
> > grep("([A-Za-z][^:]*):\\1","Ac:Ac",value=T)
> character(0)
> > grep("([A-Za-z][^:]*):\\\1","Ac:Ac",value=T)
> character(0)
> > 
> but
> > grep("([A-Za-z][^:]*):","Ac:Ac",value=T)
> [1] "Ac:Ac"
> 

I strongly suspect that no number of \s will make it work as long as
do_grep() in main/character.c contains this line:

        eflags = REG_NOSUB;



-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-