GNU diff has an option described thusly:
-I RE --ignore-matching-lines=RE
Ignore changes whose lines all match RE.
Fantastic, says you, now I can compare two files and see only if lines
which aren't comments differ by telling diff to ignore lines which
begin with a '#'.
No, says GNU, that is useful functionality which would be the logical
extension of *all* the other 'ignore' options diff accepts. What -I RE
will do instead is indicate that *the entire file* does not differ iff
*all differing lines* match the regular expression. In the highly
likely situation that lines which match your expression differ *and*
lines which don't match differ, you will see every line of difference,
whether it matches or not.
Hate.