diff has an option -I regexp, which ignores changes that just insert or delete lines that match the given regexp. I need an analogue of this for the ca
diff
-I regexp
You could use sed to replace instances of the pattern with a standard string:
diff <(sed 's/ab[XY]d/ab__REPLACED__d/g' file1) <(sed 's/ab[XY]d/ab__REPLACED__d/g' file2)