Is this what you want: > x <- "/pages-cell.net/deepan/sony/" > z <- gsub("/(.*)/", "\\1", x) > > z [1] "pages-cell.net/deepan/sony"
On Wed, Oct 8, 2008 at 8:20 PM, Waverley <[EMAIL PROTECTED]> wrote: > Hi, > > 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@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. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? ______________________________________________ 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.