Parse patterns