All-optical regeneration