Re: [R] Regex magic anyone?

2008-01-18 Thread Johannes Graumann
Great! Joh On Friday 18 January 2008 15:22:29 Gabor Grothendieck wrote: > strapply in the gsubfn package can split strings based on > content rather than delimiters. > > > library(gsubfn) > > strapply(s, ".[(].[)]|.")[[1]] > > [1] "A""B""C""D""E""F""G""T(P)" "H""I

Re: [R] Regex magic anyone?

2008-01-18 Thread Gabor Grothendieck
strapply in the gsubfn package can split strings based on content rather than delimiters. > library(gsubfn) > strapply(s, ".[(].[)]|.")[[1]] [1] "A""B""C""D""E""F""G""T(P)" "H""I" [11] "J""K" See home page at: http://gsubfn.googlecode.com and vignette: library

[R] Regex magic anyone?

2008-01-18 Thread Johannes Graumann
Hi again, how to elegantly split s <- "ABCDEFGT(P)HIJK" into "A" "B" "C" "D" "E" "F" "G" "T(P)" "H" "I" "J" "K" (independently of which letters 'T' or 'P' actually represent ...). Please jumstart my regexing, Joh __ R-help@r-project.org mailing li