An Overlay Architecture for Pattern Matching