Pattern match with compare.