[R] question of R to do perl matching and matched string extraction
jholtman at gmail.com
Thu Oct 9 04:02:33 CEST 2008
Is this what you want:
> x <- "/pages-cell.net/deepan/sony/"
> z <- gsub("/(.*)/", "\\1", x)
On Wed, Oct 8, 2008 at 8:20 PM, Waverley <waverley.paloalto at gmail.com> wrote:
> I want to extract some of the substring via pattern recognition. But
> I don't know how to do it in R.
> In perl:
> my $url = "/pages-cell.net/deepan/sony/";
> if($url =~ m/\/(.*)\//g)
> my @result = $1;
> return @result;
> How does the same work in R?
> Thanks much in advance
> Waverley @ Palo Alto
> 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.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help