On 6 October 2012 05:49, Don Kuhlman <Don.Kuhlman at schawk.com> wrote:
Hi folks. I believe the issue is my regex on the file name in the analysis.cfg. I've used about 15 different values and the only thing I seem to get working is using the direct full filename vs, a regex to match any files.
In regular expressions the asterisk is not a wildcard in the same way as in DOS/Windows. Instead, it is read as "zero or more of the previous character or symbol." So what you probably want is ".*". The dot "." is a one-character-width wildcard, which is why it needs to be escaped if you want to match a literal dot. So ".*" means zero or more of any character.
Also, a regular expression match is applied only when the match string STARTS with a percent.
However, using any combos that I can think of as a regex do not:
FILE %/Volumes/MySQL_Backups/*\.sql red mtime<86400
Here, you are asking to match zero or more slash characters before a ".sql".
FILE /Volumes/MySQL_Backups/%*\.sql red mtime<600
Doesn't start with percent.
#FILE %^*.sql red mtime>86400
Again, ".*" rather than "*".
Can anyone suggest a way to format the analysis.cfg statement to match anything that ends in .sql ?
Try this:
FILE %/Volumes/MySQL_Backups/mysql_backup_.*\.sql red mtime<86400
This should go red if the matching file is older than 1 day.
J