Add extendable pattern handling.

Had forgotten to push it.