Returns a copy of the requested pattern. Callers must destroy the pattern returned from get_pattern.