[R] regular expression submatch?
dwinsemius at comcast.net
Mon Feb 1 20:06:34 CET 2010
On Feb 1, 2010, at 1:57 PM, sjaffe wrote:
> What is the simplest way to extract a matched subexpression?
> Eg. in perl you can do
> "hello world" =~ m/hello (.*)/
> which would return 1(true) and set $1 to the matched subexpression
If you wanted a logical value returned, then
If you want the matched subexpression, use , value=TRUE.
> View this message in context: http://n4.nabble.com/regular-expression-submatch-tp1459146p1459146.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help