in reply to Match, Capture and get position of multiple patterns in the same string
Perhaps you are only interested in non-overlapping greedy matches, but that wasn't clear to me.
$_ = "fofofo"; /((?:fo)+)(?{ say "[$-[1], $+[1], $1]" })(*FAIL)/; __END__ [0, 6, fofofo] [0, 4, fofo] [0, 2, fo] [2, 6, fofo] [2, 4, fo] [4, 6, fo]
|
|---|