I have searched and was able to find this forum discussion for achieving the effect of overlapping matches.
I also found the following SO question speaking of findin
Another roundabout way of extracting the same information that I've done in the past is to replace the "match.length" with the "capture.length":
x <- c("ACCACCACCAC","ACCACCACCAC")
m <- gregexpr('(?=([AC]C))', x, perl=TRUE)
m <- lapply(m, function(i) {
attr(i,"match.length") <- attr(i,"capture.length")
i
})
regmatches(x,m)
#[[1]]
#[1] "AC" "CC" "AC" "CC" "AC" "CC" "AC"
#
#[[2]]
#[1] "AC" "CC" "AC" "CC" "AC" "CC" "AC"