Extract pattern.