Jesus regularly dealt with Pharisees of two different schools of thought: Shammai and Hillel. These two opposing schools would argue about all sorts of matters, which is apparent from the kinds of questions they brought to Jesus. The school of Shammai was rigidly legalistic. They would bicker incessantly about the meanings of words, and would apply things so comprehensively that they would even tithe from their food condiments (Mt. 23:23). They read scripture as a rule book, and all righteousness hinged around being better rule-keepers than everyone else. The school of Hillel was generally loose in their approach to Scripture. They would allow a man to divorce his wife over something as small as burnt toast, and allowed a high degree of subjectivity in applying the law of Moses. One of the only things Hillelites were rigid about was that they wanted no association with the Shammaites.
Which side did Jesus pick? Neither. Jesus felt that whether someone was a conservative Pharisee or a liberal Pharisee, all Pharisees were fundamentally missing the point. Knowing God is not primarily about rule keeping or rule abolishing. Knowing God is primarily about trying to love what God loves. Loving God means caring about personal holiness, and keeping God's commandments (John 15:10). Loving God means desiring as much mercy and grace for others as we desire for ourselves (Colossians 3:13). Jesus said that none of the law is unimportant, but the weightier matters--the parts that concern God most--are justice, mercy, and faithfulness (Mt. 23:23). If our righteousness does not hinge around our passion for these three things, it might not be righteousness at all.