You could do this: gregexpr("ab+", "abcdaabbcbb")[[1]] + 1
On Mon, Sep 27, 2010 at 2:25 PM, Titus von der Malsburg <malsb...@gmail.com>wrote: > On Mon, Sep 27, 2010 at 7:16 PM, Henrique Dallazuanna <www...@gmail.com> > wrote: > > You've tried: > > > > gregexpr("b+", "abcdaabbc") > > But this would match the third occurrence of b+ in "abcdaabbcbb". But > in this example I'm only interested in b+ if it's preceded by a+. > > Titus > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.