The
--ignore-matching-lines= option checks changed lines as well as those added or deleted. However, the original and changed lines have to match the regular expression. From the man page:
Code:
-I RE --ignore-matching-lines=RE
Ignore changes whose lines all match RE.
What this means is if you have the following file1:
Code:
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
And the following file2:
Code:
line 1
line added
line 2
line 3
line 4
line 6
line 7
line 8 changed
line 9
You get the following outputs:
Code:
$ diff file1 file2
1a2
> line added
5d5
< line 5
8c8
< line 8
---
> line 8 changed
$ diff --ignore-matching-lines='8.*' file1 file2
1a2
> line added
5d5
< line 5
$ diff --ignore-matching-lines='changed' file1 file2
1a2
> line added
5d5
< line 5
8c8
< line 8
---
> line 8 changed
It means that you have to construct your regular expression to catch both forms of the changed line (before and after)