while (/.../g) { print("Matched ", substr($var, $-[0], $+[0] - $-[0]), " at pos $-[0]\n"); }