M
Michael Yang
Here I have two files to diff, I want them compared with my rules.
Let's one is base file, the other is result file:
base file:
Connected to the '.*'
Hello everyone, I am .*
Glad to see you, .*
result file:
Connected to the 'www.perl.com'
Hello everyone, I am michael
Nice to see you, all
There are regex string ".*" in the base file, indicating that it could
be replaced by any string. When the two lines being compared, I want
it be considered equal when the ".*" matches the couter-part of the
other, like the first two lines in the files shown above.
So when diff these two files, only the last line is the difference
data after diff.
Glad to see you, .*
Nice to see you, all
I need to change the rules of diff program, and for that I need to
implement my own diff algorithm.
Is there any ways simpler to achieve this?
I don't know if there are any interface providing user-defined
comparison function to diff.
If there is, I can implement my own comparison function telling it how
to compare two lines and pass the function as the reference to the
diff function. The diff function will compare and diff files using my
comparison rules.
Your helps are greatly appreciated!!
Let's one is base file, the other is result file:
base file:
Connected to the '.*'
Hello everyone, I am .*
Glad to see you, .*
result file:
Connected to the 'www.perl.com'
Hello everyone, I am michael
Nice to see you, all
There are regex string ".*" in the base file, indicating that it could
be replaced by any string. When the two lines being compared, I want
it be considered equal when the ".*" matches the couter-part of the
other, like the first two lines in the files shown above.
So when diff these two files, only the last line is the difference
data after diff.
Glad to see you, .*
Nice to see you, all
I need to change the rules of diff program, and for that I need to
implement my own diff algorithm.
Is there any ways simpler to achieve this?
I don't know if there are any interface providing user-defined
comparison function to diff.
If there is, I can implement my own comparison function telling it how
to compare two lines and pass the function as the reference to the
diff function. The diff function will compare and diff files using my
comparison rules.
Your helps are greatly appreciated!!