in reply to Grep reutrn the occurance of a pattern
while (/.../g) { print("Matched ", substr($var, $-[0], $+[0] - $-[0]), " at pos $-[0 +]\n"); } [download]