I'm trying to extract all of the values from edm in the example below. However, the first attempt only retrieves the final number in the sequence since it is recorded using scientific notation. The second attempt retrieves all of the numbers, but omits the scientific notation component of the final number. How can I make the regular expression more general such that I get every value AND its corresponding "E"-value (i.e., "...E-06"), where pertinent? I've spent time reading through ?regex, but my attempts to use the "*" character, where the preceding item will be matched zero or more times, have so far proven syntactically incorrect or generally unsuccessful. .Appreciate the help, Eric
edm <- c("","param_value","6.301343","6.366305","6.431268","6.496230","6.561192","6.626155","9.091117E-06") param_values <- strapply(edm,"\\d+\\.\\d+E[-+]?\\d+", as.numeric, simplify=cbind) param_values #[1,] 9.091117e-06 param_values <- strapply(edm,"\\d+\\.\\d+", as.numeric, simplify=cbind) param_values #[1,] 6.301343 6.366305 6.431268 6.49623 6.561192 6.626155 9.091117 [[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.