M
Michael Yang
Here I have two files to diff, let's say one is a base file, the other
is a result file.
<base file>:
Conntected to the '.*'
Hello, I am .*
Glad to see you .*
<result file>:
Connected to the 'www.perl.com'
Hello, I am michael
Nice to meet you, all
There are regex pattern string ".*" in the base file, indicating that
it could be replaced by any text.
When the regex string of ".*" occurs, it should be detected that
whether it matches the counter-part in the result file. If it matches,
as shown above, the two lines are considered as equal.
So when diff the above two files, only the last line of two files are
in the diff data:
Glad to see you .*
and
Nice to meet you, all
If I want to do this, I need to implement my own diff algorithm.
Is there any way simpler to achieve this? Like if there is a
comparison function, designed by this regex algorithm, could be passed
to Diff object, the diff program will compare two files based on the
rules I gave to it.
Your helps are greatly appreciated.
is a result file.
<base file>:
Conntected to the '.*'
Hello, I am .*
Glad to see you .*
<result file>:
Connected to the 'www.perl.com'
Hello, I am michael
Nice to meet you, all
There are regex pattern string ".*" in the base file, indicating that
it could be replaced by any text.
When the regex string of ".*" occurs, it should be detected that
whether it matches the counter-part in the result file. If it matches,
as shown above, the two lines are considered as equal.
So when diff the above two files, only the last line of two files are
in the diff data:
Glad to see you .*
and
Nice to meet you, all
If I want to do this, I need to implement my own diff algorithm.
Is there any way simpler to achieve this? Like if there is a
comparison function, designed by this regex algorithm, could be passed
to Diff object, the diff program will compare two files based on the
rules I gave to it.
Your helps are greatly appreciated.