Re: [R] backreferences in gregexpr

2012-11-03 Thread Gabor Grothendieck
On Sat, Nov 3, 2012 at 4:08 PM, Alexander Shenkin wrote: > On 11/2/2012 5:14 PM, Gabor Grothendieck wrote: > > On Fri, Nov 2, 2012 at 6:02 PM, Alexander Shenkin > wrote: > >> Hi Folks, > >> > >> I'm trying to extract just the backreferences from a regex. > >> > >>> temp = "abcd1234abcd1234" > >>

Re: [R] backreferences in gregexpr

2012-11-03 Thread Alexander Shenkin
On 11/2/2012 5:14 PM, Gabor Grothendieck wrote: > On Fri, Nov 2, 2012 at 6:02 PM, Alexander Shenkin wrote: >> Hi Folks, >> >> I'm trying to extract just the backreferences from a regex. >> >>> temp = "abcd1234abcd1234" >>> regmatches(temp, gregexpr("(?:abcd)(1234)", temp)) >> [[1]] >> [1] "abcd123

Re: [R] backreferences in gregexpr

2012-11-02 Thread arun
ember 2, 2012 6:02 PM Subject: [R] backreferences in gregexpr Hi Folks, I'm trying to extract just the backreferences from a regex. > temp = "abcd1234abcd1234" > regmatches(temp, gregexpr("(?:abcd)(1234)", temp)) [[1]] [1] "abcd1234" "abcd1234" W

Re: [R] backreferences in gregexpr

2012-11-02 Thread Gabor Grothendieck
On Fri, Nov 2, 2012 at 6:02 PM, Alexander Shenkin wrote: > Hi Folks, > > I'm trying to extract just the backreferences from a regex. > >> temp = "abcd1234abcd1234" >> regmatches(temp, gregexpr("(?:abcd)(1234)", temp)) > [[1]] > [1] "abcd1234" "abcd1234" > > What I would like is: > [1] "1234" "1234

[R] backreferences in gregexpr

2012-11-02 Thread Alexander Shenkin
Hi Folks, I'm trying to extract just the backreferences from a regex. > temp = "abcd1234abcd1234" > regmatches(temp, gregexpr("(?:abcd)(1234)", temp)) [[1]] [1] "abcd1234" "abcd1234" What I would like is: [1] "1234" "1234" Note: I know I can just match 1234 here, but the actual example is compl