Optical grep