On Fri, Dec 17, 2010 at 07:39:46AM -0500, Gabor Grothendieck wrote: > On Thu, Dec 16, 2010 at 11:42 AM, Petr Savicky <savi...@cs.cas.cz> wrote: [...] > > Can something similar be done in R either specifically for numbers or > > for a general regular expression? > > Dieter's first post in this thread already answered that question.
I am sorry for overlooking this solution using package gsubfn, although it was pointed out repeatedly in this thread. The following solves exactly the example i was asking for. library(gsubfn) s <- "abcde. 11 abc 5.31e+34, (1.45)" strapply(s, "[0-9]+\\.[0-9]+e[+-][0-9]+|[0-9]+\\.[0-9]+|[0-9]+")[[1]] [1] "11" "5.31e+34" "1.45" Thank you for this information. Petr Savicky. ______________________________________________ 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.