Hi all -- I have two files I've been trying to compare with diff. The files are automatically generated and feature a number of lines that look like:
//! Generated Date : Mon, 14, Dec 2009
I'd like those differences to be ignored, and have set out to use the "-I REGEX" flag to make that happen.
However, the number of spaces that appear between "Date" and the colon varies and unfortunately, it seems the flavor of regular expressions employed by diff lacks a number of the basic regex utilities.
For instance, I cannot for the life of me get the "one or more" plus-sign to work. Same deal with the "\s" representation of whitespace.
diff -I '.*Generated Date\s+:.*' ....
and
diff -I '.*Generated Date +:.*' ....
both fail spectacularly.
Rather than continuing to blindly try things, can somebody out there point me to a good reference on the diff-specific subset of regular expressions?
Thanks!
===== EDIT =======
Thanks to FalseVinylShrub, I've established that I should be escaping my '+' and any similar characters. This fixes the problem somewhat. Diff successfully matches
.*Generated Date \+.*
and
.*Generated Date *.*
(Note that there are two spaces between "Date" and "*".)
However, the second I try to add the ':' to that expression, like so:
.*Generated Date \+:.*
and
.*Generated Date \+\:.*
Both versions fail to match the string in question and cause diff to take a significantly greater amount of time to run. Any thoughts there?