Letter and spirit of the law
The letter of the law versus the spirit of the law is an idiomatic antithesis. When one obeys the letter of the law but not the spirit, one is obeying the literal interpretation of the words (the "letter") of the law, but not necessarily the intent of those who wrote the law. Conversely, when one obeys the spirit of the law but not the letter, one is doing what the authors of the law intended, though not necessarily adhering to the literal wording.
This article needs additional citations for verification. (April 2008)
"Law" originally referred to legislative statute, but in the idiom may refer to any kind of rule. Intentionally following the letter of the law but not the spirit may be accomplished through exploiting technicalities, loopholes, and ambiguous language.