[R] question of R to do perl matching and matched string extraction

Waverley waverley.paloalto at gmail.com
Thu Oct 9 02:20:56 CEST 2008


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

More information about the R-help mailing list