Photonic technology is gradually replacing traditional electronic functionality, particularly in all-optical communications network. Optical filtering, switching, and amplification and optical memory are already proven functions and more optical functionality is emerging. Optical pattern detection is a key function for optical signal processing and it is applicable to optical packet identification, error control, wavelength assignment, and routing. All optical pattern detection eliminates optical-electrical-optical (OEO) conversions that add significantly to complexity and cost of system and network. We describe a direct optical pattern detector that in real time recognizes patterns in optical binary streams of synchronous frames or asynchronous packets. We demonstrate the detection of start of frame of an optical signal, and we describe the applicability of the method to all-optical digital-to-analog conversion. Simulation results support the detector optical circuitry.