extract match info to a directive