-while ($f = shift @list) { # next field
- # print "f: $f list: ", join(',', @list), "\n";
- if (!$from && !$to) {
- ($from, $to) = $f =~ m|^(\d+)[-/](\d+)$|; # is it a from -> to count?
- next if $from && $to > $from;
- }
- if (!$to) {
- ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
- next if $to;
- }
- if (lc $f eq 'dxcc') {
- $dxcc = 1;
- next;
- }
- if (lc $f eq 'rt' || $f =~ /^real/i) {
- $real = 1;
- next;
- }
- if (lc $f eq 'on' && $list[0]) { # is it freq range?
- # print "yup freq\n";
- if ($list[0] =~ m|^(\d+)(?:\.\d+)?[-/](\d+)(?:\.\d+)?$|) {
- push @freq, $1, $2;
- shift @list;
+ # disguise regexes
+ $line =~ s/\{(.*?)\}/'{'. unpack('H*', $1) . '}'/eg;
+ dbg("sh/dx disguise any regex: '$line'") if isdbg('sh/dx');
+
+ # now space out brackets and !
+ $line =~ s/([\(\!\)])/ $1 /g;
+
+ my @list = split /\s+/, $line; # split the line up
+
+ # put back the regexes
+ @list = map { my $l = $_; $l =~ s/\{([0-9a-fA-F]+)\}/'{' . pack('H*', $1) . '}'/eg; $l } @list;
+
+ dbg("sh/dx after regex return: '" . join(' ', @list) . "'") if isdbg('sh/dx');
+
+ my @out;
+ my $f;
+ my $call = $self->call;
+ my $usesql = $main::dbh && $Spot::use_db_for_search;
+ my ($from, $to) = (0, 0);
+ my ($fromday, $today) = (0, 0);
+ my $exact;
+ my $real;
+ my $dofilter;
+ my $pre;
+ my $dxcc;
+
+ my @flist;
+
+
+ dbg("sh/dx list: " . join(" ", @list)) if isdbg('sh/dx');
+
+ while (@list) { # next field
+ $f = shift @list;
+ dbg("sh/dx arg: $f list: '" . join(',', @list) . "'") if isdbg('sh/dx');
+ if ($f && !$from && !$to) {
+ ($from, $to) = $f =~ m|^(\d+)[-/](\d+)$| || (0,0); # is it a from -> to count?
+ dbg("sh/dx from: $from to: $to") if isdbg('sh/dx');
+ next if $from && $to > $from;
+ }
+ if ($f && !$to) {
+ ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
+ $to ||= 0;
+ dbg("sh/dx to: $to") if isdbg('sh/dx');
+ next if $to;
+ }
+ if (lc $f eq 'day' && $list[0]) {
+ ($fromday, $today) = split m|[-/]|, shift(@list);
+ dbg("sh/dx got day $fromday/$today") if isdbg('sh/dx');