Solution to problem in filter using "matches" expr
Posted: Wed Nov 12, 2008 12:54 pm
FYI.... I was having problems when I used the "matches" expression in filters. For example: I set PurgeWhenFull filter to only delete <Name><matches><Event> because if I renamed an event, I probably wanted to keep it. However, the matches clause would cause a sql error. I fixed the error by adding single quotes around the $value variable in filter.pl.
Changed from this:
Changed to this:
I thought that I could place single quotes around the <Event> text in the filter window but this would not work. I found that I had to place the quotes in the PERL script.
Changed from this:
Code: Select all
if ( $filter_terms{$op_name} eq '=~' )
{
$filter_sql .= " regexp $value";
}
elsif ( $filter_terms{$op_name} eq '!~' )
{
$filter_sql .= " not regexp $value";
Code: Select all
if ( $filter_terms{$op_name} eq '=~' )
{
$filter_sql .= " regexp '$value'";
}
elsif ( $filter_terms{$op_name} eq '!~' )
{
$filter_sql .= " not regexp '$value'";