Displaying 1 result from an estimated 1 matches for "abcdaabbc".
2010 Sep 27
7
Regular expressions: offsets of groups
Dear list!
> gregexpr("a+(b+)", "abcdaabbc")
[[1]]
[1] 1 5
attr(,"match.length")
[1] 2 4
What I want is the offsets of the matches for the group (b+), i.e. 2
and 7, not the offsets of the complete matches. Is there a way in R
to get that?
I know about gsubgn and strapply, but they only give me the strings
matched by groups...