in reply to How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments?

  1. strip comments
  2. step two, diff
  • Comment on Re: How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments?

Replies are listed 'Best First'.
Re^2: How to know if two files (.c,.h,.cpp) are different content-wise ignoring the comments?
by iphone (Beadle) on Feb 13, 2011 at 06:45 UTC

    how can a tool diff and figure out if they are different or not after stripping the comments?

        I am trying to use diff tool but use the -I option to ignore lines that start with "File Name:".i am using the below regular expression,there is no syntax error but the diff tool still shows changes with line that starts with "File Name:".Any idea what is going wrong?

        diff -I '[^\s*File\sName:]' file1 file2