Fixed escaping in patternMatch